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?
...
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?
...
Hey.
I saw a couple of questions here on SO, with ansers including the function isEqual: instead of the standard ==.
So far, I have only learned to use the ==, so I'm wondering what's better to use, what are the pros and cons of each? When should you use them?
Thank you.
...
Hi Guy's
I need to get the duration of video captured using UIImagePickerViewController Can any one tell me how could it possible to get the duration.
Thanks in advance,
Kiran.
...
Hi to all,
I have created a music application in iphone which have more than 50 songs.When i want to play the song i need to click on the song and then play after that when i want to hear the next song in series i need to click on the song and play. i want that when i play a particular song and after that song completes playing the next ...
How to make etags generate tags for both the declaration (i.e. inside the @interface block) and the definition (i.e. inside the @implementation block)?
The default behavior is only to generate tags for the definition. I've already tried to invoke etags with --declarations but that didn't solve the issue. A way would be to pass a custom ...
So I have just started learning objective c having a little Java experience and this site has been really helpful for answering loads of my questions, but I've hit an issue I can't quite fathom. Theres a fair amount to be read on the topic but I can't quite find where I've gone wrong.
So I read this:
Objective C does not support cl...
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?
...
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?
...
[[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.
...
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 ?
...
Is there a tutorial for saving and restoring an array of custom objects?
...
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)?
...
Hi all.
I am trying to learn cocoa and have a few problems with KVC and bindings. I have a nstableview with three columns; "checkbox", "text", "icon". The values of each column is binded to an arraycontroller using KVC. When program is launched the rows and columns are correctly filled into the tableview according to the values in the ...
Hi, i have an NSString and a webView in my project (Objective-C for iPhone), i have called index.html in webView and in index.html i have written my script (javascript)
How can i pass the NSString as a var in my script and viceversa?
http://developer.apple.com/library/safari/#documentation/AppleApplications/Conceptual/SafariJSProgTopics/...
(void)getFacebookProfile {
NSString *urlString = [NSString stringWithFormat:@"https://graph.facebook.com/me?access_token=%@", [_accessToken stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSURL *url = [NSURL URLWithString:urlString];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDidFinishSe...
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?
...
Hey all, this should be pretty simple to answer:
Is there a property of a NSURL such as lastPathComponent and StringByDeletingPathExtension that actually gives you just the extension instead?
If so, what is it? Thanks!
...
I keep getting: Unable to create request (bad url?) error message on a request like:
- (void)grabURLInBackground :(id)sender
{
NSURL *url= [NSURL URLWithString:@"http://api.website.com/api_requests/standard_request/getItemRequest={\"Id\":\"Logic\"}"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request ...
iPhone/iPad SimpleTableViewCells: What replaces the deprecated setImage setText on table cells?
The below code gives warnings that setImage and setText are deprecated. So what replaced them? What is the new better way to get this simple behavior?
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cel...