objective-c

JSON or SOAP (XML) ?

I'm developing a new application for the company. The application have to exchange data from and to iPhone. Company server side uses .NET framework. For example: the class "Customer" (Name, Address etc..) for a specific CustomerNumber should be first downloaded from server to iphone, stored locally and then uploaded back to apply cha...

how can i store value in an NSArray using WritetoFile?

i wana store the index of seleted cell of table using NSArray, can u help me.... ...

How do I set these break points in ~/.gdbinit?

Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems: fb -[NSException raise] fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] #define NSZombies # this will give you help me...

next line character a huge influence on xmlparser?

I have question about a basic xml file I'm parsing and just putting in simple nextlines(Enters). I'll try to explain my problem with this next example. I'm( still) building an xml tree and all it has to do ( this is a testtree ) is put the summary in an itemlist. I then export it to a plist so I can see if everything is done correctly....

getaddrinfo in iPhone

I prepare small application. When I restart my iPhone 3G (with 3G internet connection) and install this application getaddrinfo always return EAI_NONAME(8). I close application and run Safari then run my application - all work. What's problem? - (void)viewDidLoad { [super viewDidLoad]; const char* hostname = "google.com"; ...

Reading MP3 information using objective c

Hi There, I have mp3 files stored on the iphone and I my application to be able to read the ID3 infomration, i.e length in seconds, artist etc. Anyone know of how to do this or what library to use in objective c? Your thoughts are much appreciated. ...

Use Objective-C game engine in C++ iphone game?

You often hear that C++ is preferable to Objective-C for games, especially in a resource-constrained environment like the iPhone. (I know you still need some Objective-C to initially talk to iPhone services.) Yet, the 2D game engine of choice these days seems to be Cocos2d, which is Objective-C. I understand that what Apple calls "Obje...

Animating a view on top of another view

I want to animate a view on top of another view in my iphone app. I basically want my view to look like the apple keyboard except with my custom controls. When i click a button I want the new view to animate up, from the bottom of the screen, on top of part of the view. How would I do this? ...

How do I release self (UIImageView) in touchesEnded?

I have an object that is a child of UIImageView. Before all these touches methods, I add this object to the superview and then user moves it. In touchesEnded, sometimes I want to release self. I've tried: - [self release] or - [self removeFromSuperview] But all these tries end up in exceptions. What's the right way to release self...

Objective-C indentation in emacs

I'm using Emacs to edit my Objective-C code. The default indentation looks like this: NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(callback:) userInfo:nil repeats:YES]; I would like Emacs to indent the code like XCod...

NSDate init question, related to memory management in Objective-C

I have an NSDate object created by NSDate *date = [[NSDate alloc] init]; Later, I want to reset the date to the "now", so I thought that [date init]; or date = [date init]; might do the job, but they don't. Instead, [date release]; date = [[NSDate alloc] init]; works. I'm a bit confused about this, since in the documentation ...

iPhone: RegexKit vs. RegexKit lite - going through an array takes very very long

For my app I need to see if an url is Matched by a regex string. so I created an array with all the regex strings (about 1000+ strings) and check them using RegexKit lite: for (NSString * aString in mainDelegate.whiteListArray) { if (![urlString isMatchedByRegex:aString]) { it works but sadly this operation takes very very long. at l...

symbol not found when using ScriptingBridge.framework (Mac OS X)

I have included the ScriptingBridge.framework in the target, and it currently shows under Link Binary with Libraries. I generated a header using: sdef "/Applications/Address Book.app" | sdp -fh --basename AddressBook The header was generated ok. However, at compile time, I get the following error: Undefined symbols: ".objc_class_n...

What exactly does rangeOfCharacterFromSet do?

NSString *foo = @" x "; NSRange r = [foo rangeOfCharacterFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSLog(@"foo range = %d,%d",r.location, r.length); Results in "foo range = 0,1" So will it ever return a length > 1? ...

When does selectedCell change?

I have an NSTableView and I want to do something whenever the selectedCell element changes. So, my table view is called tableView, and this is what I want to observe: [tableView selectedCell] I tried using key-value observing, but that didn't seem to work, or maybe I was doing it wrong. Any ideas? ...

Converting between C enum and XML

What's the cleanest way to store an enum in XML and read it back out again? Say I've got: enum ETObjectType {ETNormalObjectType, ETRareObjectType, ETEssentialObjectType}; ...and I want to take a variable, enum ETObjectType objectType = ETNormalObjectType;, and convert it to XML that looks like this: <objectType>ETNormalObjectType</obj...

Is Macro Better Than UIColor for Setting RGB Color?

I have this macro in my header file: #define UIColorFromRGB(rgbValue) \ [UIColor colorWithRed:((float)((rgbValue So I want to ask everyone is this better or should I use this approach: cell.textColor = [UIColor colorWithRed:66/255.0 green:33/255.0 blue:33/255....

Problems with IBOutlet getting nil.

I have an instance of a class "A" in my EAGLView class, it gets instantiated in the EAGLView's initWithCoder method. This class "A" contains an IBOutlet to a UIView. I also have an instance of this class "A" in the Interface Builder, to connect the class "A" IBOutlet to the corresponding view. So the class "A" is being instanciated t...

How do I know when a page has failed to load in UIWebView as opposed to being "Stopped" by the user?

Hey Guys, I have a UIWebView within my application which I'm using to provide web browsing functionality. I have a button on my toolbar which calls -(void)stopLoading; on the UIWebView. The problem with this is that when this method is sent to the web view, the delegate receives the - (void)webView:(UIWebView *)webView didFailLoad...

Difference in App load time when built for distribution?

This may sound like an odd question, but has anyone noticed that their iPhone apps launch quicker when built for distribution over being built for debugging? Our app initially launches really slowly when compiling it for debugging / running it through xcode. (on device) So I then dis-connected the phone from xcode and ran some extremel...