objective-c

Any suggestions on where to learn C online in preparation of learning Objective-C

I've been programming PHP & mySQL for about 8 years now. I understand and make use of modern software architectures and OOP in my projects on a daily basis. I decided I want to learn something new. I finally decided yesterday that I want to learn C and eventually Objective-C so I can begin creating Mac / iOS applications. (Would you rec...

UITextField in UITableView cell is returning null

Hi all, I've been banging my head against the wall on this one for quite some time now. Any input or direction is greatly appreciated. So the goal is the create a log in form from text fields in a table. That user info, once collected will be passed on to an array in a seperate view controller so in can stored in a "favourites" list. ...

Please confirm: NSTimer is to repeatedly make an event occur at intervals.

I'm trying to make an iOS app. As part of the app, I want a UIScrollView to scroll every X seconds. I believe that I need to use NSTimer. Is this correct? ...

How to scan a thing from a iphone application

i want to know how to scan a paper from a iphone cam and i need to read the data on the paper later i want to store the data... is it possible..? please give me a thought... Thanks.. ...

Web-Radio Streaming on the iPhone

Hello folks. I've seen a number of radio apps for the iPhone that stream internet audio such as MP3, AAC, etc. I've been questioned by my boss about the possibility of making a radio app for a client, but have no idea of the requirements, limitations and/or possibilities. What exactly is needed for a radio streaming app? An mp3/AAC fi...

merging an nsarray into an nsset and avoiding duplicates in objective-c on iphone

Edit: better example... So I have an NSMutableSet of "existing" objects and I'd like to download JSON data, parse it, and merge these new objects with my existing ones, updating any duplicates with the newly downloaded ones. Here's what the existing set of objects looks like: NSArray *savedObjects = [NSArray arrayWithObjects: [NSD...

NSDistantObject Protocol for iphone

I've been reading through the docs on how the NSDistantObject class and I can see that it is more or less a binary protocol for sending objects from one NSPort to another. What I'm curious about is the possibility of using this in an iPhone application to share data. Is it possible to have two applications talking to each other on distin...

Objective-C problems performing math on an integer

I have the following line of code which is running on a timer: NSLog( @" seconds: %i, elapsedhours %f", [self elapsedSeconds], [self elapsedSeconds] / 3600); It prints out: seconds: 0, elapsedhours 0.000000 seconds: 1, elapsedhours 0.000000 seconds: 2, elapsedhours 0.000000 seconds: 3, elapsedhours 0.000000 I'm wondering why elapse...

Possible risk with asynchronous request and delegation

Hi, I would like to add to UIImageView the capacity to set an image with an url. As result I would like to do something like. [anImageView setImageWithContentAtUrl:[NSURL URLWithString:@"http://server.com/resource.png"]]; So I created a category (code below). NSString *kUserInfoImageViewKey = @"imageView"; NSString *kUserInfoActivit...

NSURLConnection redirected on iOS device, but not on simulator

When I make a request to a particular website, I get the XML response as desired on the simulator but I get a redirect page on the device. I think this is because it is detecting that I am using a mobile browser (similar results occur through Mobile Safari), but I'm setting the user agent string of the request to my laptop browser's UA ...

How to force an NSTextField to accept the text?

I have an NSTextField in a Preferences panel. It provides a field to enter a url in. However, if the user closes the Preferences panel after editing the text in the field, the new value does not get propagated to the User Defaults. This only happens after the user explicitly does Enter or Tab. This kind of makes the whole approach useles...

Print the name of the calling function to the debug log

Objective-C's runtime seems to be rather robust, so I was wondering if there's a way to log the name of the function that called the current function (for debugging purposes). My situation is that a bunch of things assign to a property, and rather than set a breakpoint and examine the call stack each time, I'd like to just NSLog the nam...

Formatting seconds into hh:ii:ss

I have app that is a basic timer. It tracks the number of seconds the app has run. I want to convert it so the seconds (NSUInteger) are displayed like: 00:00:12 hh:mm:ss. So I've read this post: http://stackoverflow.com/questions/1528822/nsnumber-of-seconds-to-hours-minutes-seconds From which I wrote this code: NSDate *date = [NSDate ...

CoreData: Crash purging caches after a Memory warning

I've got a stack trace showing a crash responding to a memory warning: Thu Oct 28 00:42:55 iPhone DTMobileIS[10853] : _memoryNotification : {name = (null), num = 1} Thu Oct 28 00:42:55 iPhone DTMobileIS[10853] : _memoryNotification : { OSMemoryNotificationLevel = 1; timestamp = "2010-10-28 07:42:55 GMT"; } Thu O...

Objective-C arrayWithPlist (that's already in an NSString)

I have an NSString that already contains a pList. How do I turn it into an NSArray? (WITHOUT saving it to disk, only to reload it back with arrayWithContentsOfFile, and then have to delete it.) Where is the make arrayWithPlist or arrayWithString method? (Or how would I make my own?) NSArray *anArray = [NSArray arrayWithPlist:myPlistS...

Access another Application's window/views objective-c Mac

On mac OSX, using objective-c, is it possible to access another applications window and its views? So if I have one application with just a label which says Hello World, can I create another application that will be able to access the first application's view hierarchy and get the text "Hello World"? I have relative amount of experience...

Objective C - NSthread & NSAutoreleasePool?

What is the best way to write a thread safe method? I have the following method, sometimes i want to call it asynchronously (call it through a thread) And sometimes i want to call it directly on the main thread. Is there a problem with keeping the pool (alloc, release) even if I am not calling the method on a separate thread? - (void)d...

NSIntersectionRange with a 0 length argument

In Objective C, when using the function NSIntersectionRange with one of the arguments being zero length, does the result equal the other argument? Didn't see this when I searched so I wanted to clarify it for others. ...

NSSpeechSynthesizer delegate method always reports an error, but which one?

I have the following delegate method for NSSpeechSynthesizer: - (void) speechSynthesizer:(NSSpeechSynthesizer *)sender didFinishSpeaking:(BOOL) success { NSLog(@"Finished correctly = %d", success); [startButton setEnabled:YES]; [stopButton setEnabled:NO]; } The parameter "success" is always NO, even though I heard everyth...

How to I respond to a user pressing a UISegment?

How to I respond to a user pressing a UISegment? Is there a delegate, or must I programmatically (or Interface Builder), attach the selectors? ...