iPhone, Objective-C 2 A HelloWorld example Here is Paul's Hello World example for iPhone SDK 2.2. Here are the major steps toward your Hello World example: Start Xcode, create a new "Window-Based Application" named "HelloWorld" Download a picture from [www.iPhone-wallpapers.org], right-click "HelloWorld" at the top of your "Group&files" panel, and Add existing to add the background picture you just downloaded Double click Resources->MainWindows.xib, this brings up the IntefaceBuilder Make sure the Library tab is visible, if not, click tools -> Library to bring it up. Make sure the Inspector tab is visible, otherwise click tools -> Inspector to bring it up. Inspector panel has four tabs: inspector for changing UI object properties, connectors tab for connecting events-actions, and properties-objects, size tab, and an identity tab where you can set object names, properties, and actions. Search the library for "UIView" class, drag and drop "View" (not View Controller) into your "Window". Click inspector panel and go to identify tab. Set it's class name to MainView, add an action named "showText" typed id, and add an Outlet mainText typed UILabel. Drag and drop a "UIImage" and "UILabel" and "UIButton" to your MainView. Customize them accordingly Now check out MainWindow.xib, you should have three layers of UI objects: layer 0 is Windows. MainView is its only sub-object. Under MainView, you should have three objects: a UIImage, a UILabel, and a UIButton. In MainWindow.xib panel, drag and drop MainView onto UILabel, and drag and drop UIButton to MainView to set up connectors. Click MainView, then File->Write class code. Click Classes, then Add existing MainView.h and MainView.m In MainView.h, make sure MainView inherits from UIView, and add "@property (nonatomic, retain) UILabel mainText;" to the front of @end In MainView.m, implement showText with "mainText.text = @"Hello World!";" Build and Go A few nits while duplicating Paul's example. If you get [MainView makeKeyAndVisible]: unrecognized selector sent to instance, make sure you follow exactly the same order when you drag-drop objects to create connectors.[NN] 3 xcode doesn't support iphone os 3.0.1? Run this command on your development Mac desktop/laptop: ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\)/ /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1 [CH] If it suddenly stops working and shows "Could not support development" again, try restart your phone. This usually happens after you do something with iTunes. 4 Debug with you device Become a paid iphone developer by joining the developer program Wait for the email from apple, and activate your account Go to http://developer.apple.com/iphone/manage/certificates/team/index.action to request a certificate After it's approved and generated, download it, and double click it to add it to your keychain when you program compiles, it will look for the developer certificate in your keychain, and use it to sign your app Create a profile here Download your profile, drag it onto your xcode icon, this installs profile in your xcode Connect your device, start xcode, open Window->Organizer, add profile to your iphone device Compile you app, now it should be looking for the profile matching your "Bundle identifier" in info.plist file. Set up your device 5 How to "go to definition"? command + double click 6 CABasicAnimation symbols not found right-click frameworks in your iphone project, click "Add existing framework". Look for /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework and add it. 7 this class is not key value coding-compliant for the key xxx If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name. If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Here is Paul's Hello World example for iPhone SDK 2.2.
Here are the major steps toward your Hello World example:
A few nits while duplicating Paul's example.
If you get [MainView makeKeyAndVisible]: unrecognized selector sent to instance, make sure you follow exactly the same order when you drag-drop objects to create connectors.[NN]
3 xcode doesn't support iphone os 3.0.1? Run this command on your development Mac desktop/laptop: ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\)/ /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1 [CH] If it suddenly stops working and shows "Could not support development" again, try restart your phone. This usually happens after you do something with iTunes. 4 Debug with you device Become a paid iphone developer by joining the developer program Wait for the email from apple, and activate your account Go to http://developer.apple.com/iphone/manage/certificates/team/index.action to request a certificate After it's approved and generated, download it, and double click it to add it to your keychain when you program compiles, it will look for the developer certificate in your keychain, and use it to sign your app Create a profile here Download your profile, drag it onto your xcode icon, this installs profile in your xcode Connect your device, start xcode, open Window->Organizer, add profile to your iphone device Compile you app, now it should be looking for the profile matching your "Bundle identifier" in info.plist file. Set up your device 5 How to "go to definition"? command + double click 6 CABasicAnimation symbols not found right-click frameworks in your iphone project, click "Add existing framework". Look for /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework and add it. 7 this class is not key value coding-compliant for the key xxx If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name. If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Run this command on your development Mac desktop/laptop:
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\)/ /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
If it suddenly stops working and shows "Could not support development" again, try restart your phone. This usually happens after you do something with iTunes.
4 Debug with you device Become a paid iphone developer by joining the developer program Wait for the email from apple, and activate your account Go to http://developer.apple.com/iphone/manage/certificates/team/index.action to request a certificate After it's approved and generated, download it, and double click it to add it to your keychain when you program compiles, it will look for the developer certificate in your keychain, and use it to sign your app Create a profile here Download your profile, drag it onto your xcode icon, this installs profile in your xcode Connect your device, start xcode, open Window->Organizer, add profile to your iphone device Compile you app, now it should be looking for the profile matching your "Bundle identifier" in info.plist file. Set up your device 5 How to "go to definition"? command + double click 6 CABasicAnimation symbols not found right-click frameworks in your iphone project, click "Add existing framework". Look for /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework and add it. 7 this class is not key value coding-compliant for the key xxx If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name. If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
command + double click
6 CABasicAnimation symbols not found right-click frameworks in your iphone project, click "Add existing framework". Look for /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework and add it. 7 this class is not key value coding-compliant for the key xxx If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name. If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
right-click frameworks in your iphone project, click "Add existing framework". Look for /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework and add it. 7 this class is not key value coding-compliant for the key xxx If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name. If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
If this happens in a TabBar-based iphone application, and the view of your tabs are loaded from nib files, make sure you set the correct view controller class file name in both the tab nib and the main tab: (1) double click your tab nib file, and change "ower of the file"'s class name. Then double click main window, and click on your tab item, and change controller class name.
If not, then go thru you xib in interface builder, and look for dead links related to your key name. You might have accidentally added a link to maybe UITextField or something where it shouldn't be. 8 How do I support internalization? Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc. Theh strings files contains key value pairs like the following "Uploading" = "Uploading in english" To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file: CFBundleDisplayName = "App Name In Your Language"; To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files. 9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Take chinese as an example, create a directory called zh_CN.lproj under you project home directory. Then in xcode, File->New->Other (below Mac OSx)->String File. Name your file Localizable.strings and put it under zh_CN.lproj. Same thing with en_lproj, cn_TW.lproj, etc.
Theh strings files contains key value pairs like the following
"Uploading" = "Uploading in english"
To display your app name in a localized language, create another strings file as you did just now, but name it InfoPlist.strings, and put the following in this file:
CFBundleDisplayName = "App Name In Your Language";
To used Localizable.strings in interface builds, use Tools > Strings. Right click your nib file, click get-info from context menu, add localization with your locale. Then you can edit language-specific nibs by double clicking it. Make sure you clean your project (build->clean) after you make changes to nib files.
9 How do I use system icons in interface builder? Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones. Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Option 1: in the properites tab of your item (i-bar), under identifier, select system default ones.
Option 2: copy system png files from simulator dir? Not sure if this is against apple developer agreements. 10 How do I use navigation controller and tabbarcontroller in interface builder? If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder. Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll. To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController. To push the second UIViewController into the stack, use something similar to the following code: SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES]; 11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
If you want to use UINavigationController instead of regular UIViewController for a specific tab, then, when you create that tab bar, instead of dragging a UITabBarItem into your interface builder, try to drag a UINavigationController into your UITabBarController folder in interface builder.
Double click "TabBarItem" in your newly added tab. Click on the view, and load it from a separate xib file, e.g., RootNavigationView.xib. This is going to be the first layer in your Navigation viewcontroller stack. It could be any UIViewController with no special fields required. Create a companion UIViewController for it, e.g., RootNavigationViewControll.
To add addition layers into your ViewController stack, you need to create additional xib files and additional UIViewController files. The only thing special is that you must have a navigationItem IBOutlet field in these additional UIViewControllers, and an additional UINavigationItem in each of the xib files, and you need to link them together. You could watch this video to see how this is done. For the sake of argument, let's call them SecondNavigationView.xib and SecondNavigationViewController.
To push the second UIViewController into the stack, use something similar to the following code:
SecondNavigationViewController *secondNavigationViewController = [[SecondNavigationViewController alloc] initWithNibName:"xibfilenameWithoutDotXib" bundle:nil]; [[self navigationController] pushViewController:settingsTwitterAccountControl animated:YES];
11 How do I change the backbutton title in the navigation bar? Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack. If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Remember that the "back" title shown in one ViewController item is controlled by it's parent. Odd, but that's how it works. If you want different child ViewControllers of one stack layer to use different "back" button titles, then you'll need to implement that in your code: for example, [[[self navigationItem] backBarButtonItem] setTitle:@"customized title"], and then push the child ViewController onto the stack.
If you code doesn't seem to work, and if you are using Interface Builder to create your ViewControllers, then make sure you set "Back button" property of the navigationItem you want to set in your code to something. It seems like IB would set backBarButtonItem to nil if you don't set any title text, then if you send setTitle to nil, it does nothing. 12 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
When you call initWithNibName, leave out the .xib part and only use the main file name. 13 unrecognized selector sent to class when calling start() method on a Thread class subclassed from NSThread In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
In my case, I was creating it with [MyThread init] instead of [[MyThread alloc] init] 14 UIPickerView.setRow doesn't seem to be working? Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Make sure you selectRow after view has been loaded, for example, in viewDidLoad() 15 How do I implement multi-line input boxes like the ones used in ical? Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Use UITableViewController [TB] 16 What is the MIME type for .mov video files recorded on iphone? video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
video/quicktime. [W3C] 17 How do I use GData in iphone apps? [JW] Download objective-c client from google website, to checkout the most recent copy, use "svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only" Open project, drag GData Sources into your project. Make sure you uncheck "Copy file if necessary" Open Project -> Edit project settings, set "Other Linker Flags" in Linker section to "-lxml2", and set "Header Search Path" in search paths section to "/usr/include/libxml2". 18 How do I use round corners in my table? If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
[JW]
If you are using interface builder, set your table view to "grouped" (as apposed to plain). If you are creating table view programatically, use initWithStyle. 19 The iphone system default background looks nice, how do I use it in my views? If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
If you are using UITableView, set your style to grouped, it'll show up automatically. 20 How do I custmoize UITableViewCell? You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website. If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
You can custmoize by extending UITableViewCell or adding subviews to UITableViewCell.contentView. Look at the example on apple website.
If you are using round cornered table sections (by setting UITableView style to UITableViewStyleGrouped), you might needed to set backgroundColor of your newly added subview to [UIColor clearColor] 21 What are the things I need to do to increase the chance of my app being accepted into app store? https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
https://developer.apple.com/iphone/news/appstoretips/ 22 How do I get the phone number of current app user? As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
As of now (09/27/2009), you can still get it from global preferences: [[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"] 23 How to make my app connect to wifi when it starts? Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Add the following to your AppName-info.plist file: key is, value is an array with an element "wifi" 24 Memory leak during property assignment? In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release] works fine. 25 What is "#pragma mark" in my code? These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code. 26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
In my case, anObject.foo = [[[Foo alloc] init] autorelease] causes leak warning, however, the following is fine
Foo *foo = [[Foo alloc] init]; anObject.foo = foo; [foo release]
These are compiler "pre-processor" instructions. Xcode uses this one to group methods. These are only used at compile time and won't affect any logic in your code.
26 How do I use iphone scroll view? http://www.youtube.com/watch?v=j27U9d5hD3A 27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
http://www.youtube.com/watch?v=j27U9d5hD3A
27 HOw do I check if a file is a directory? use ileExistsAtPath:isDirectory: 28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
use ileExistsAtPath:isDirectory:
28 Hide tabbar, using full screen view under UITabBarController? This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID] 29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
This is not possible because UITabBarController always crops/resizes your view to make sure UITabBar is not covered [ID]
29 My MKMapViewDelegate methods never get called? Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Instead of embedding your MKMapViewDelegate methods in your UIViewController, try to put it in a separate class inherited directly from NSObject. Not sure why, but to me, that worked fine. Also had to retain that delegate instance, seems like MKMapView is not retaining delegate member when we call "mapView.delegate = xxx" 30 Why is my scrollViewDidEndZooming never get called? Make sure UIScrollView.enablePaging = YES 31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Make sure UIScrollView.enablePaging = YES
31 warning: check_safe_call: could not restore current frame? Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Check if you app is using too much memory, consider respond to didReceiveMemoryWarning. 32 I already set all my data to auto-release memory, however, I am still getting out of memory crashes If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
If you use a lot of memory in a loop (for example, loading images in loops), then you probably want to create a NSAutoreleasePool in your loop. Or try to release your memory explicitly.
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
33 Expected primary-expression before ‘=’ token Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Check if you accidentally used #define x = ### instead of #define x #### 34 I am really pissed by EXC_BAD_ACCESS error, why can't objective support garbage collection?! You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example [[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease] looks very suspicious. 35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
You are right in that EXC_BAD_ACCESS is caused by sending messages to objects that have already been released. There are different arguments about why we don't have gc in iphone SDK, let's not go there. Easiest way to debug this issue is to shift+cmd+f and search for "release]". Look thru everyone of them and see if you releasing anything you aren't supposed to release, for example
[[[UIButton buttonWithType:UIButtonTypeRoundedRect] autorelease]
35 How do I show a splash screen when my app starts? Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
Add a file named Default.png to your project. If needed, clean and rebuild your project 36 How do I use a local images in webview html? NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; Comments References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp
NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL];
References[CH] http://iphoneworld.codinghut.com/2009/08/iphone-os-3-0-1-advisory-for-developers-only/[ID] http://edr.euro.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html[JW] http://www.johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/[NN] http://forums.macnn.com/79/developer-center/370199/unrecognized-selector-sent-to-instance/[TB] http://www.raddonline.com/blogs/geek-journal/iphone-sdk-using-a-uitableviewcell-with-a-uitextview-for-entering-text-part-1-of-2/[W3C] http://www.w3schools.com/media/media_mimeref.asp