Coming from a .NET background where you can easily generate an object model from an XML schema (through, for example xsd.exe) I wanted to know if there is a similar facility for generating Objective-C/NSObject objects.
Thanks!
...
When setting the method of a button call or adding an event listener in objective-c, one normally sets the target to self. However I have a subclass of NSObject named CALLS, separate from the main file. This subclass has a void called METHOD_NAME which should be executed.
THe first question is would the void be
+(void)METHOD_NAME
or
...
I am writing an iPhone app where the user is supposed to be able to turn on and turn off all the pins on the map. To put all the pins on the map I use:
-(void) putAllPins {
for (id key in myDictionary) { //A NSDictionary
NSArray *data = [myDictionary objectForKey:key];
[self putPin: data];
}
isShowingAllPins ...
I need to replace a method in an object with my own implementation. For example,
Person *p; // some object
NSMutableArray *array = [NSMutableArray array];
[array addObject: p];
How can I replace addObject with a method of my own?
In other words, is there a way to replace the implementation of addObject: of a SPECIFIC object with ano...
What's the best way to grab a succession of images from the camera using the AV Foundation framework? I am only interested in what an iPhone 3G can support. I haven't been able to find any information on which classes are not supported on the iPhone 3G (without video capability).
Has anyone had any experience with this?
Many thanks,
Br...
I am following Apple's ScrollSuite example, however pinch to zoom is not working. I am not sure whats wrong:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
// set up main scroll view
imageScrollView = [[UIScrollView alloc] initWithFram...
- (void)createAString:(NSString **)str
{
*str = [NSString stringWithString:@"Hi all!"];
[*str autorelease]; // ???? is this right ?
}
How should I use release or autorelease ? I don't want to release outside of the function of course :)
...
NSString *createStr;
[self createAString:&createStr];
NSLog(@"%@", createStr);
...
I am updating our iPhone app to iOs4 and I ran into an issue "Pass-by-argument in function call is undefined" in the code
for (i = 0; i < self.numberOfSegments; i++) {
[self setWidth:round(width[i]) forSegmentAtIndex:i];
}
Which is fair enough, width[i] hasn't been initialized. Updating the code (below) however gives me this...
I have a currently working program that has IBOutlet and IBAction connections from the interface to File's Owner. I made a new class, and added that to the document window in Interface Builder. Then I moved everything from the File Owner class files to the new class files. I removed the old connections and reconnected everything to the n...
I have a UIScrollView and a UIImageView which I have created programatically without interface builder. How can I make sure both auto-rotate in horizontal orientation?
...
How to validate a phone number (NSString *) in objective-c? Rules:
minimum 7 digits
maximum 10 digits
the first digit must be 2, 3, 5, 6, 8 or 9
Thanks
...
Table data in SQLite database shows fine in Simulator but does not appear when deployed to device.
Would appreciate if anyone can help.
...
I don't mean to start a code formatting holy war here, but I'm wondering if anyone has any advice on how to best format nested blocks in Objective-C.
Here's some code I wrote today:
[UIView animateWithDuration:1.0
animations:^{
self.alpha = 0.5;
}
completion:^(BOOL finished){
[UIView animateWithDuration...
I am having a strange error in the program. However, I do not find any syntax error. The error is: expected ')' before 'NSRect'. How can I get rid of it? I get those errors in line 1 and 2. I also tried importing Foundation/NSGraphics.h. It did not work.
#import <Foundation/Foundation.h>
@interface MyQuartzView : NSObject {
}
- (id)i...
Here are two methods that return a dictionary of my custom four-propery objects. They make arrays of strings, floats and BOOLs to put in the Chemical objects, then build a dictionary from the arrays. I'm new enough to the whole memory management game that I'm not always sure when I own something and when to release it. I'm making all ...
I would like to clear a view before an application is switched away from, to change the launch image so that the next time the app is entered it will not display some insecure data.
iOS 4 provides applicationDidEnterBackground and applicationWillResignActive...however, neither of these seem to be able to prevent the screenshot from bein...
I've got a method that when put a breakpoint in it and hover over a string, says it's out of scope and you can drill down into the NSString object for what seems like forever. I've tried to put a screen shot... hope it shows up. I think I have some serious memory management problems...
http://web.me.com/gazelips/Site/Blank_files/scree...
does iphone 4.0 support sms service??
...
How would I have a button that would add a Section to a UITableView? I know how to do it without adding sections and just having a list but how would you allow the user to add section as well as cells/rows.
...
we are trying this for password settings,so that cursor should not be visible to user.
...