cocoa-touch

does UITableViewController have special behavior when being popped off a UINavigationController stack?

I've got a bizarre what-seems-like-a-over-release issue in a tab bar application. My advance apologies for the complexity of this problem description. Hopefully a little example code will help. I have my application delegate MyAppDelegate set up as the UITabBarControllerDelegate: - (BOOL)tabBarController:(UITabBarController *)tabBarC...

url not getting inserted in SQLite3 database

Hi All, i'm trying to insert the url links in the SQLite3 database but its crashing does any one have any idea ... y its happening ? if i statically trying to insert any url, it works but dynamically when i get urls of navigated web pages.... they do not insert.... please suggest me how to make it work. I'm using SDK 3.2 this is my i...

How to get day, month, year, hours, minutes, seconds from a UNIX timestamp in Objective C on Iphone

I have been going up and down through all kinds of reference docs and examples over the web but I just can't get how to get what day, month, year, hours, minutes will it be for a given timestamp in Objective C. Any ideas? The code I'm using for the purpose is like this: NSDate *date = [NSDate dateWithTimeIntervalSince1970:128618100...

Is UITableViewController compatible with NSCoding?

When I try to get a h file that inherits from UITableViewController to conform to NSCoding, I can't switch views. - (id) initWithCoder:(NSCoder*) coder { [self init]; return self; } Inserting the above code into the m file is what causes the problem. Why is that? ...

How to restore an array with NSCoder

So far I have the following: - (id)initWithCoder:(NSCoder*) coder { self = [super initWithCoder: coder]; if (self) { // Call a setup method } return self; } Am I supposed to put the code to load the array in here? What could should I put and where should I put it? ...

problem in displaying a xib as Ipad in universal application

Hi all, I have an already running iphone app with target OS 3.1. I am trying to transform it into a universal app. I am not going to change the model, only the xib. So I wrote the ipad xib in IB, then I went to info.plist and add MainIpad Nib for ipad pointing to a proper MainIpad.xib. I also set Target Device Family in project info to ...

grid-like control for iPad

Is there any grid-like control in iPad SDK? ...

When does encodeWithCoder get called?

This will save an array (I think). - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:myArray forKey:@"myArray"]; } Do I have to directly call this method when I want to save an array or do I have to do something else? ...

When does initWithCoder get called?

This will load an array - (id)initWithCoder:(NSCoder*) coder { self = [super initWithCoder: coder]; if (self) { myArray=[coder decodeObjectForKey:@"myArray"]; } return self; } What is the code that will call this function so that the array can be loaded? ...

Does this write or read an array?

[[NSUserDefaults standardUserDefaults] setObject:myArray forKey:@"myArray"]; I'm trying to figure out how to save and load an array using NSUser Defaults. I already have the NSCoding delegate methods defined, just need to know the actual commands to execute that will call those methods. ...

Get UILabel out of UIButton

I have an UIButton to which an UILabel was added as a subview. Is there an easy way to get the UILabel back out of it so I can change it's title ? ...

Testing a iPhone app in iOS 3.0

I have a program that ran in iOS 2.0 and now am making some updates to it. I don't think I have done anything that won't be available in 3.0, but I don't have a 3.0 device around to test it on. I do know that I updated one deprecated function addTimeInterval to the new version dateByAddingTimeInterval a few questions - 1) Is there ...

Tutorial for saving an array of custom objects

Is there a tutorial for saving and restoring an array of custom objects? ...

How to get a main (window?) UIView in iOS?

I'm developing a PhoneGap app, extending it with native stuff. I can make an UIView like this: [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] and show some stuff like ActionSheets here. But the MBProgressHUD doesn't show up in this view. So how do I get the main view (or the PhoneGap's WebView)? ...

Authenticating GKLocalPlayer with Game Center

I am trying to authenticate a GKLocalPlayer with Game Center. However, the code supplied by Apple - (void) authenticateLocalPlayer { [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { if (error == nil) { // Insert code here to handle a successful authentication. ...

coder encodeObject

Consider the following code [coder encodeObject: properties forKey:@"properties"]; Are there any restrictions on what kind of object is passed as an argument to encodeObject? Can it be an object from a custom class? ...

How do I duplicate iPad display over TV out?

Is it possible to simply duplicate ipad display to TV out (assuming both have same resolution)? Code like this doesnt seem to work (it is a pretty naive implementation) int i=0; for (UIScreen *screen in [UIScreen screens]) { if(i>0) { UIWindow* extWindow = [[UIWindow alloc]init]; extWindo...

How to easily persist application state upon exit

Let's say that my application state is extracted into an object (so that all information specific to app instance is contained in one object) and that object supports nscoding protocol. How can i easily persist it and load it on exit/launch of my application? My current code looks like this - (BOOL)application:(UIApplication *)applicat...

How to get all the UITableViewCell from UITableView?

Hi Guys, I have a list reusable UItableViewCells. As what I want: after selecting one of the cells, the app should update the images on each Cell. For solving this requirement, I use method visibleCells to fetch all the cells from UITableView, and update the images in each cell by iterating the returned cell array. But the problem is:...

UIActionSheet Crashes on iPad / not iPhone

When I look in the console I get this message 2010-09-18 17:04:05.284 Wasted Time[8998:207] *** Assertion failure in -[UIActionSheet showInView:], /SourceCache/UIKit_Sim/UIKit-1145.66/UIAlert.m:7073 2010-09-18 17:04:05.286 Wasted Time[8998:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'I...