objective-c

Using NSXMLParser with CDATA

I'm parsing an RSS feed with NSXMLParser and it's working fine for the title and other strings but one of the elements is an image thats like <!CDATA <a href="http:image..etc> How do I add that as my cell image in my table view? Would I define that as an image type? This is what i'm using to do my parsing: - (void)parser:(NSXMLPars...

Where can I find sample codes for iPhone applications?

I develop iPhone applications as a hobby. I want to make an application using UITabBarController, UINavigationController and UITableView . Could you please post links to example that use these three Classes? Thank you ...

NSLog not printing to terminal

Ok, so I've been using NSLog in objective-C for awhile now to debug and I know it's supposed to print to the terminal whatever I put in the parentheses. For some reason, it just stopped printing to the terminal and I'm not sure how to fix this error. I was wondering what other people would suggest doing to fix this problem. I've only inc...

Get rid of "'NSObject' may not respond to '-someMethod'" warning

I'm learning ObjectiveC and ran into a problem relating to introspection. Basically, I'm looping through an array of objects and determining if they accept the lowercaseString selector. If they do, I call that selector on the object. After I ensure that the object responds to that selector, I call it. However, when I do, I get this warni...

Enabling Save for an NSDocument

Hello, I am using an NSDocumentController subclass to do some custom stuff when I create my NSDocuments. The strange thing is that when the document is created, the Save option in the menu is disabled. The problem is that I use the save function to save something manually out from the document so it's decoupled from the main NSDocument ...

Instance methods calling class methods calling instance methods

In a word, how? I have a view controller that creates a few custom objects. One of those objects needs to call a method back in the controller. The object looks like it wants to call a class method in the controller, which might be fine, except that class in the controller needs to call an instance method in the controller, and it doesn...

GPS Location

I want to get my longitude and latitude on iphone in objective C. can any one guide me how to get these coordinates programmatically ...

Strange Descriptions for Arrays in XCode debugger

When debugging my program in the XCode debugger, if I hovered my mouse over an array variable, the XCode debugger used to show me how many objects were in the array and I could even examine the objects themselves. Somewhere along the line this functionality was broken and now it just says there are "-1812597152 objects" in all my arra...

using the twitter api in objective C

So, the twitter API has the method "statuses/update": URL: http://twitter.com/statuses/update.format Formats: xml, json, rss, atom HTTP Method(s): POST Requires Authentication (about authentication): true API rate limited (about rate limiting): false Parameters: * status. Required. The text of your status update. URL encod...

kCFNumberFormatterScientificStyle and kCFNumberFormatterDecimalStyle hybrid? - iphone / objective-c

in objective-c or iphone development has anyone ever done dynamic number formatting - something along the lines of "use kCFNumberFormatterDecimalStyle until the number gets too big, then use kCFNumberFormatterScientificStyle instead?" i want to display a number with some sort of hybrid between the two, but i'm having a little trouble wi...

Objective-C Properties in iPhone Development

Hi, Whats the difference between a property and an instance variable in Objective-C. I need to understand this in OOP terms. Is a property declaration just a convenience wrapper (with @synthesize in the implementation) for accessing instance variables? thanks, codecowboy. ...

Uiswitch on/off

hi, m new to objective-c, i have made a application of login page in which i have used UISwitch to remember d login details if switch is in on mode. i have done with to remember the login details but problem is that how to use the switch on/off condition. Thanx in advance ...

Is it safe to use isKindOfClass: against an NSString instance to determine type?

From the isKindOfClass: method documentation in NSObject: Be careful when using this method on objects represented by a class cluster. Because of the nature of class clusters, the object you get back may not always be the type you expected. The documentation then proceeds to give an example of why you should never ask something like th...

How to get CLLocationManager in my app

@class CLLocationManager; @interface CLLocationController : NSObject { CLLocationManager *locationManager; } @property (nonatomic, retain) CLLocationManager *locationManager; @end When i write above code is shows me following errors error: CLLocationManager.h: No such file or directory warning: receiver 'CLLocationManager' i...

UITableView Animation Headache

NSIndexPath* updatedPath = [NSIndexPath indexPathForRow: 0 inSection: 0]; NSIndexPath* updatedPath2 = [NSIndexPath indexPathForRow: 1 inSection: 0]; NSArray* updatedPaths = [NSArray arrayWithObjects:updatedPath, updatedPath2, nil]; [self.mySexyTableView reloadRowsAtIndexPaths:updatedPaths withRowAnimation:UITableViewRowAnimationTop]; ...

iPhone Application

Hello, I want to integrate some links on my iphone application. That is when user touch on the button say "Yahoo" then Yahoo's page will be opened and then all the functionalities of Yahoo mail has proceeds. How can I do that? I have a bit idea about NSURL, but not much. Please help me for that. Thanks in advance.. ...

is it necessary to release a NSInteger in iphone?

i am getting this error does some one knows about it??? 2009-07-08 18:42:36.778 FlashCards[1297:20b] Category Id=1 FlashCards(1297,0xa0690fa0) malloc: * error for object 0x4fd78a0: pointer being freed was not allocated FlashCards(1297,0xa0690fa0) malloc: * error for object 0x4fdc200: double free *** set a breakpoint in malloc_error_break...

Optimized Image Loading in a UIScrollView

I have a UIScrollView that has a set of images loaded side-by-side inside it. You can see an example of my app here: http://www.42restaurants.com. My problem comes in with memory usage. I want to lazy load the images as they are about to appear on the screen and unload images that aren't on screen. As you can see in the code I work out a...

Unit Testing of private methods in Xcode

I'm trying out test driven development in a toy project. I can get the tests working for the public interface to my classes (although I'm still on the fence because I'm writing more testing code than there is in the methods being tested). I tend to use a lot of private methods becuase I like to keep the public interfaces clean; however,...

Objective-C: Extract filename from path string

When I have NSString with '/Users/user/Projects/thefile.ext' I want to extract 'thefile' with Objective-C methods. What is the easiest way to do that? Thanks. ...