This is Part 3 of 3 for my NSXML Parser Tutorial. Part 1 – www.youtube.com Part 2 – www.youtube.com
Source : iphonedevx[dot]com
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
This is Part 3 of 3 for my NSXML Parser Tutorial. Part 1 – www.youtube.com Part 2 – www.youtube.com
Introducción a la Programación en iOS
Image by Nearsoft
@ Summer Talks 2011
Important things to know before you start development, Honestly this should be the first lesson before starting development iphone development tutorial “Macworld” “expo” “steve” “jobs” “iphone” “ipod” “apple” “touchscreen” “keynote” “nano” “video” “iphone” “sdk” “development” “tutorial” “app” “store” “beginner” “getting” “started” “hello” “world” “xcode” “iphone” “sdk” “development” “programming” “objective-c” “iphone development tutorial” “app” “store” “beginner” “getting” “started” “hello” “world” “iphone” “dev” “tutorial”
Objective-C® for Dummies® by Neal Goldstein, Copyright © 2009 by Wiley Publishing, Inc., is the main source of information for this video. In this lesson we go into Xcode and try out what we learned in Part 1. Twitter – twitter.com FaceBook – www.facebook.com E-mail – macandcomputerhelp@gmail.com Objective-C Tutorial objective-c tutorial objective c tutorial
Video Rating: 4 / 5
Question by Teeter: What are some magazines that are in print for development and programming?
I need one that actually mails out, not online. Can be about:
* Website development
* Website programming
* Website design
* Database programming
* Linux or linux server administration
* Open source software
* Mac programming or iPhone programming (there are probably not very many of these)
* Specific languages: Java, Javascript, HTML
Best answer:
Answer by Victor
I used to subscribe to Linux magazine. Good insight on upcoming items and code snippets on hot topics. Good read. Recommended.
see:
http://www.linux-mag.com/contact
Give your answer to this question below!
Description: Objective-C video tutorials — In these programming video series I’ll go through the basics of objective-c object oriented programming language. Objective-c is the programming language of Apple Mac OSX Operating system and the language of iOS. So if you want to develop applications for Mac, iPhone, iPad, and iPod touch then you have to master objective-c programming language. It’s one of the best programming language and it’s easy to learn. It is derived from the C language but it’s Object-oriented which makes it better. These video tutorials are for beginners and gradually we’ll discuss the advanced part of objective-c as time goes on. If you have any questions drop a comment. And don’t forget to rate and like all the videos to allow others to benefit from these objective-c video tutorials.
Every since updated my iPhone 5 and iPad 3 to iOS 6.1.2, Siri will not launch any apps except Apple own. After every other request, Siri replieswith the response, "I don't see an app named".
How to use the NSMutableArray class in Objective-C.
Video Rating: 5 / 5
THE #1 BESTSELLING BOOK ON OBJECTIVE-C 2.0
Programming in Objective-C 2.0 provides the new programmer a complete, step-by-step introduction to Objective-C, the primary language used to develop applications for the iPhone, iPad, and Mac OS X platforms. The book does not assume previous experience with either C or object-oriented programming languages, and it includes many detailed, practical examples of how to put Objective-C to use in your everyday iPhone/iPad or Mac OS X progr
List Price: $ 44.99
Price:
Description: Objective-C video tutorials — In these programming video series I’ll go through the basics of objective-c object oriented programming language. Objective-c is the programming language of Apple Mac OSX Operating system and the language of iOS. So if you want to develop applications for Mac, iPhone, iPad, and iPod touch then you have to master objective-c programming language. It’s one of the best programming language and it’s easy to learn. It is derived from the C language but it’s Object-oriented which makes it better. These video tutorials are for beginners and gradually we’ll discuss the advanced part of objective-c as time goes on. If you have any questions drop a comment. And don’t forget to rate and like all the videos to allow others to benefit from these objective-c video tutorials.
Question by Advice Please: If you want to add data to an iphone script. What type of file do you do this with?
Also, can you submit an iphone programmed with a windows pc? I know it has to be coded on a mac, but if someone codes it and emails you the files, can they be forwarded onto apple this way? Can the windows person fill out a data file or does that have to also be done on a mac? Say I had a list of soups I wanted to have listed on the application. Can the windows pc create that list or does it have to be a mac file?
Best answer:
Answer by Rodrigo33024
You can import data to your iphone app by creating a plist or a sqlite file, they both can be created on a PC or mac, they are just text files with the information that you will be importing.
Once you have the plist or sqlite files you need to import them to xcode in the resources folder and your iphone application will need to be programmed to open the file, read its content and display it.
You will also need to recompile your app after that.
Know better? Leave your own answer in the comments!
Review:
“Most of the books I scanned, even the ‘Dummies’ series, assumed a basic knowledge of computer programming even for iOS beginners. What I like about Kevin’s writing is that he doesn’t make any assumptions — he just takes you there — step by step.” – Lorraine Akemann – Moms With Apps
Unleash the App Developer Within!
This first book in the series from Kevin McNeish, award-winning App Developer, highly acclaimed iOS trainer and conference speaker, is specifically desi
List Price: $ 16.99
Price:
LightingPad is the perfect tool for controlling small shows, or for installing and testing lighting systems. It’s also great for programming our LightCue Pro lighting controller. Simply connect any Art-Net compatible DMX device to your wireless network, and you have a complete lighting console in the palm of your hand. Because it’s an iPad / iPhone application, it’s incredibly simple to use. For more information, visit www.alcorn.com
Editor’s note: Some of you asked us to write a tutorial about audio recording. This week, we work with Raymond Au from Purple Development to give you an introduction of AVFoundation framework. Raymond is an independent iOS developer and has recently released Voice Memo Wifi that allows users to record voice memo and share it over WiFi.
iOS provides various framework to let you work with sound in your app. One of the frameworks that you can use to play and record audio file is the AV Foundation Framework. In this tutorial, I’ll walk you through the basics of the framework and show you how to manage audio playback, as well as, recording.
To provide you with a working example, I’ll build a simple audio app that allows users to record and play audio. Our primary focus is to demonstrate the AV Foundation framework so the user interface of the app is very simple.
The AV Foundation provides easy ways to deal with audio. In this tutorial, we mainly deal with these two classes:
First of all, create a “Single View Application” and name it as “AudioDemo”. To free you from setting up the user interface and code skeleton, you can download the project template from here.
I’ve created a simple UI for you that it only contains three buttons including “Record”, “Stop” and “Play”. The buttons are also linked up with the code.
AudioDemo Project Template
By default, the AVFoundation framework is not bundled in any Xcode project. So you have to add it manually. In the Project Navigator, select the “AudioDemo” project. In the Content Area, select “AudioDemo” under Targets and click “Build Phases”. Expand “Link Binary with Libraries” and click the “+” button to add the “AVFoundation.framework”.
Adding AVFoundation Framework
To use the AVAudioPlayer and AVAudioRecorder class, we need to import
| 1 | #import <AVFoundation/AVFoundation.h> |
First, let’s take a look how we can use AVAudioRecorder to record audio. Add the AVAudioRecorderDelegate protocol and AVAudioPlayerDelegate in the ViewController.h. We’ll explain both delegates as we walk through the code.
| 1 | @interface ViewController : UIViewController <AVAudioRecorderDelegate, AVAudioPlayerDelegate> |
Next, declare the instance variables for AVAudioRecorder and AVAudioPlayer in ViewController.m:
| 1 2 3 4 | @interface ViewController ( ) { AVAudioRecorder *recorder; AVAudioPlayer *player; } |
The AVAudioRecorder class provides an easy way to record sound in iOS. To use the recorder, you have to prepare a few things:
We’ll do the setup in the “viewDidLoad” method of ViewController.m. Simply edit the method with the following code:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - ( void )viewDidLoad { [super viewDidLoad ]; // Disable Stop/Play button when application launches [stopButton setEnabled : NO ]; [playButton setEnabled : NO ]; // Set the audio file NSArray *pathComponents = [ NSArray arrayWithObjects : [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES ) lastObject ], @ "MyAudioMemo.m4a", nil ]; NSURL *outputFileURL = [ NSURL fileURLWithPathComponents :pathComponents ]; // Setup audio session AVAudioSession *session = [AVAudioSession sharedInstance ]; [session setCategory :AVAudioSessionCategoryPlayAndRecord error : nil ]; // Define the recorder setting NSMutableDictionary *recordSetting = [ [ NSMutableDictionary alloc ] init ]; [recordSetting setValue : [ NSNumber numberWithInt :kAudioFormatMPEG4AAC ] forKey :AVFormatIDKey ]; [recordSetting setValue : [ NSNumber numberWithFloat : 44100.0 ] forKey :AVSampleRateKey ]; [recordSetting setValue : [ NSNumber numberWithInt : 2 ] forKey :AVNumberOfChannelsKey ]; // Initiate and prepare the recorder recorder = [ [AVAudioRecorder alloc ] initWithURL :outputFileURL settings :recordSetting error : NULL ]; recorder.delegate = self; recorder.meteringEnabled = YES; [recorder prepareToRecord ]; } |
Note: For demo purpose, we skip the error handling. In real app, don’t forget to include proper error handling.
In the above code, we first define the sound file URL for saving the recording. and then configure the audio session. iOS handles audio behaviour of an app by using audio sessions. Upon launch, your app automatically gets an audio session. You can grab such session by calling [AVAudioSession sharedInstance] and configure it. Here, we tell iOS that the app uses “AVAudioSessionCategoryPlayAndRecord” category which enables both audio input and output. We will not go into the details of audio session but you can check out the official document for further details.
The AVAudioRecorder uses a dictionary-based settings for its configuration. In line 21-25, we use the options keys to configure the audio data format, sample rate and number of channels. Lastly, we initiate the audio recorder by calling “prepareToRecord:” method.
Note: For other settings keys, you can refer to AV Foundation Audio Settings Constants.
We’ve completed the audio preparation. Let’s move on to implement the action method of Record button. Before we dive into the code, let me explain how the “Record” button works. When user taps the “Record” button, the app will start recording and the button text will be changed to “Pause”. If user taps the “Pause” button, the app will pause the audio recording till the “Record” is tapped again. The audio recording will only be stopped when user taps the “Stop” button.
Edit the “recordPauseTapped:” method with the following code:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - (IBAction )recordPauseTapped : ( id )sender { // Stop the audio player before recording if (player.playing ) { [player stop ]; } if ( !recorder.recording ) { AVAudioSession *session = [AVAudioSession sharedInstance ]; [session setActive : YES error : nil ]; // Start recording [recorder record ]; [recordPauseButton setTitle : @ "Pause" forState :UIControlStateNormal ]; } else { // Pause recording [recorder pause ]; [recordPauseButton setTitle : @ "Record" forState :UIControlStateNormal ]; } [stopButton setEnabled : YES ]; [playButton setEnabled : NO ]; } |
In the above code, we first check whether the audio player is playing. If audio player is playing, we simply stop it by using the “stop:” method. Line 7 of the above code determines if the app is in recording mode. If it’s not in recording mode, the app activates the audio sessions and starts the recording. For recording to work (or sound to play), your audio session must be active.
In general, you can use the following methods of AVAudioRecorder class to control the recording:
For the Stop button, we simply call up the “stop:” method to the recorder, followed by deactivating the audio session. Edit the “stopTapped:” method with the following code:
| 1 2 3 4 5 6 | - (IBAction )stopTapped : ( id )sender { [recorder stop ]; AVAudioSession *audioSession = [AVAudioSession sharedInstance ]; [audioSession setActive : NO error : nil ]; } |
You can make use of AVAudioRecorderDelegate protocol to handle audio interruptions (say, a phone call during audio recording) and the completion of recording. In the example, the ViewController is the delegate. The methods defined in AVAudioRecorderDelegate protocol are optional. Here, we’ll only implement the “audioRecorderDidFinishRecording:” method to handle the completion of recording. Add the following code to ViewController.m:
| 1 2 3 4 5 6 | - ( void ) audioRecorderDidFinishRecording : (AVAudioRecorder * )avrecorder successfully : ( BOOL )flag { [recordPauseButton setTitle : @ "Record" forState :UIControlStateNormal ]; [stopButton setEnabled : NO ]; [playButton setEnabled : YES ]; } |
After finishing the recording, we simply change the “Pause” button back to “Record” button.
Finally, it comes to the implementation of the “Play” button for audio playback using AVAudioPlayer. In the ViewController.m, edit the “playTapped:” method using the following code:
| 1 2 3 4 5 6 7 | - (IBAction )playTapped : ( id )sender { if ( !recorder.recording ) { player = [ [AVAudioPlayer alloc ] initWithContentsOfURL :recorder.url error : nil ]; [player setDelegate :self ]; [player play ]; } } |
The above code is very straightforward. Normally, there are a few things to configure an audio player:
The delegate of an AVAudioPlayer object must adopt the AVAudioPlayerDelegate protocol. In this case, it’s the ViewController. The delegate allows you to handle interruptions, audio decoding errors and update the user interface when an audio has finished playing. All methods in AVAudioplayerDelegate protocol are optional, however. To demonstrate how it works, we’ll implement the “audioPlayerDidFinishPlaying:” method to display an alert prompt after the completion of audio playback. For usage of other methods, you can refer to the official documentation of AUAudioPlayerDelegate protocol.
Add the following code in ViewController.m:
| 1 2 3 4 5 6 7 8 | - ( void ) audioPlayerDidFinishPlaying : (AVAudioPlayer * )player successfully : ( BOOL )flag { UIAlertView *alert = [ [UIAlertView alloc ] initWithTitle : @ "Done" message : @ "Finish playing the recording!" delegate : nil cancelButtonTitle : @ "OK" otherButtonTitles : nil ]; [alert show ]; } |
You can test audio recording and playback using a physical device or software simulator. If you test the app using actual device (e.g. iPhone), the audio being recorded comes from the device connected by the built-in microphone or headset microphone. On the other hand, if you test the app by using the Simulator, the audio comes from the system’s default audio input device as set in the System Preference.
So go ahead to compile and run the app! Tap “Record” button to start recording. Say something, tap the “Stop” button and then select the “Play” button to listen the playback.
AudioDemo App
For your reference, you can download the complete source code from here. Feel free to leave me comment if you have any questions.
This post is contributed by Raymond Au from Purple Development. Raymond is an independent iOS developer and has recently released Voice Memo Wifi that allows users to record voice memo and share it over WiFi.
Video notes are in progress. Check back here, or on Skillshare.com for an update. Skillshare iPhone class. skl.sh Class Notes – Kickoff Video (1/28/13) Q: Will the Xcode software update affect how useful the Big Nerd Ranch books are? A: Everything should work and look the same. They’re the best books to start with and are written for beginners. Xcode’s improvements are more real-time feedback as you’re typing. (It’s better at suggesting and fixing things) Q: What chapters should we have read by the next class? A: Chapters 1-14 Objective-C Programming Q: If we have to choose between the two Big Nerd Ranch books, which one is more critical? A: If you’re new to programming. I’d recommend Objective-C Programming in a heart beat. If you’ve done C++/C then get the iOS Programming Book Q: When creating a team of 1-3 people, is that for the purpose of all working on one app together? Or just a small group to get feedback from on your own app idea? A: It can be to work on an app idea, or just to have a small study group. You’ll learn more if you teach each other the material. Having people to bounce questions off and answer questions is critical for deeper learning. Q: After taking the screen shot with command+shift+4, how to I access the picture? A: It’s on your desktop with a date stamp as it’s name. Q: How can we post our project Thursday before we make it? A: On Thursday you’ll post your project idea. Write a description, include a picture and create mockups or drawings of the …
The greatest sites out there are always notable for their attention to detail. One often underestimated detail is the existence of a useful and user-friendly 404-error page. WordPress provides an easy way to create and customise the 404-error page, but unfortunately, the simplicity in customization does not automatically mean effectiveness.
The well-known WordPress SEO expert Joost de Valk (aka yoast) reports his recent findings from several years of website SEO audits. According to this report a significant number of the websites audited had problems with optimising their 404-error page. The default WordPress theme (currently TwentyTwelve) has a very basic template for this case and not so many site owners go beyond that.
Let’s look at this from the common sense point of view. When does a 404 error occur? When someone clicks on a link that should point to content on your site, but for whatever reason there is no corresponding page: maybe you have changed a permalink or removed the page, maybe you have changed the tags or category slug, maybe the link was just wrong. There are any number of reasons for the error, but one important fact cannot be denied: the visitor is already on your site, s/he is already interested in something, s/he has already made an effort to find it, so this effort should be rewarded.
One of the fundamental rules of UI is not to leave users in dead-ends without guidance. There is always a back button in the browser, but do you really want your visitor to have to use it?
?Apple provides a sitemap on their 404-error page accompanied with a simple and clear message.
37signals use the extra opportunity to present their products, and provides contact information to solve the problem.
Zurb‘s 404-error page emphasises the option to contact them with a problem. Designers should solve problems, right?
?Problogger presents a wide range of various content to dive into reading.
Justin Tadlock‘s Blog uses breadcrumbs to present a homepage link.
What can be done to improve this situation? How can the mistake be turned into an opportunity?
In search of ideas and guidelines we can consult WordPress Codex or Google Webmaster Guidelines as perfect starting points. Actually, our main task is quite simple: explain why a page can’t be located and offer suggestions for getting to the right screen. From this point of view we can derive a list of possible components that creates a “perfect” 404-error page:
From this list we can determine useful tips and ideas for what to include in a 404-error template:
One important thing about a 404-error page is a proper 404 HTTP status that should be served by the server. Fortunately, WordPress handles this for us automatically, so that we can focus our efforts on creating the page itself. We need the active theme to have a separate template for the page named 404.php. The bare bones structure of the template is quite simple:
<?php
/**
The template for displaying 404 pages (Not Found).
**/
get_header(); ?>
<div id="content" class="not-found-page">
<!-- page content goes here -->
</div>
<?php get_footer(); ?>
The markup that creates the page structure should correspond with what’s used by the active theme. Alternatively, some additional styling can be provided to imitate that structure. By including the standard calls get_header and get_footer we ensure that the page has all the branding elements and navigation options and all scripts and styles are loaded properly.
Now, when we have made the initial preparations, let’s fill in the page. The best thing we could do for the visitor on the 404 page is to guess what’s actually requested and provide the closest possible match. Information about the requested URL is stored by WordPress in the $wp->request property. We can parse that string and try to find similar content based on post_name data, which stores information about post and page slugs. If such a search does not return anything meaningful we can try a regular search through post content. If these efforts do not produce any positive results we can always provide a list of recent posts as a fallback.
Of course, we also include the friendly message, the search form and a link to the homepage.
First we are going to create some auxiliary functions to handle some template routines; they could be included in functions.php of your theme or directly in the beginning of 404.php file.
function frl_get_requested_slug(){
global $wp;
$q = $wp->request;
$q = preg_replace("/(\.*)(html|htm|php|asp|aspx)$/","",$q);
$parts = explode('/', $q);
$q = end($parts);
return $q;
} frl_get_requested_slug function tries to obtain the requested page slug using the global $wp object and regular expressions. The code assumes that the site uses permalinks and the request goes in the appropriate form.
function frl_list_posts($posts){
if(empty($posts))
return '';
$list = array();
foreach($posts as $cpost) {
$title = apply_filters('the_title', $cpost->post_title);
$url = get_permalink($cpost);
$list[] = "<li><a href='{$url}'>{$title}</a></li>";
}
return implode('', $list);
} frl_list_posts helps to quickly output a list of post links, accepting an array of WP_Post objects as arguments.
function frl_load_error_style(){
if(!is_404())
return;
$src = get_template_directory_uri().'/css/error-style.css';
wp_enqueue_style('error-style', $src);
} frl_load_error_style loads custom styles with the 404 template, assuming that the appropriate .css file is located in the /css folder inside the active theme’s directory.
The template code as we planned includes four parts: the friendly message; the search; the recent posts list; the last chance.
The friendly message:
<!-- Message -->
<h2>404: Page not found</h2>
<div class="message not-found">
<p>Sorry, unfortunately, we could not find the requested page.</p>
<p>Let's find the information you need.</p>
</div>
The search for the requested content:
<!-- Did you mean -->
<?php
$q = frl_get_requested_slug();
$args = array(
'post_type' => 'any',
'post_status' => 'publish',
'name' => $q,
'posts_per_page' => 5
);
$query = new WP_Query($args); //query posts by slug
if(empty($query->posts)){ //search for posts
$q = str_replace('-', ' ', $q);
$args = array(
'post_type' => 'any',
'post_status' => 'publish',
's' => $q,
'posts_per_page' => 5
);
$query->query($args);
}
if(!empty($query->posts)):
?>
<h4>Were you looking for the one of the following pages?</h4>
<ul class="posts-list">
<?php echo frl_list_posts($query->posts);?>
</ul>
<?php endif;?>
First of all, we perform a WordPress query with an initial set of arguments which looks for the requested slug in a post/page name field. If we don’t get any results after that, we replace dashes in the requested string with spaces and perform another query that searches for the requested words in the posts/pages content. If we’ve obtained any results we then output them with the help of the previously created frl_list_posts function.
Recent posts list:
<!-- Recent content -->
<?php
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 5
);
$query->query($args);
if(!empty($query->posts)):
?>
<h4>Why not take a look through the most recent posts?</h4>
<ul class="posts-list">
<?php echo frl_list_posts($query->posts);?>
</ul>
<?php endif;?>
In this part we perform a query for the 5 most recent posts in the blog and output them in the same manner as previously.
The last chance:
<!-- Search options -->
<?php $home_link = home_url(); ?>
<h4>No good?</h4>
<p>Please use the search form to try again or start browsing from the <a href='<?php echo $home_link;?>'>Homepage</a>.</p>
<p>If you need further assistance please don't hesitate to contact at <em>info@domain.com</em>.</p>
<?php get_search_form();?>
Finally, if none of the above options satisfy the user, we offer a link to the homepage and provide a search form.
It seems that we have done our best to help the visitor on the 404-error page. Actually, the best help there is to prevent the 404 page ever being used. In particular, we can:
There’s no real excuse why your site or blog should not have a helpful and user-friendly 404-error page. I hope, that this guide has given you some helpful tips.
What do you have on your 404 page? What do you find useful when you encounter 404 pages? Let us know in the comments.
Featured image/thumbnail, lost image via Shutterstock.