objective-c

iPhone SDK Internet connection detection

I'm working on an iPhone application that makes a few calls to web services. I posted this application on the Apple store but it got rejected (and rightly so) since there was no error message displayed to the user if no Internet connection is available. Since obviously the application would not work without it. So I just wanted to know ...

Multi-touch is not working in the iphone app I'm building

I have the following code: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSUInteger touchCount = 0; // Enumerates through all touch objects for (UITouch *touchb in touches){ touchCount++; } // When multiple touches, report the number of touches. if (touchCount > 1) { lblStatustouch.text = [NSString stringW...

adding a func in an objective-c category

I am a objective C newbie. Why do i get a warning for calling a func i created in a category? #import <stdio.h> #import <objc/Object.h> @interface MyObj: NSObject { @public int num; } -(void) print; @end @implementation MyObj; -(void) print { printf("%d\n", self->num); } @end @implementation MyObj(more) -(void) quack { ...

Documents and Nib files: What does apple mean by "Document"?

I don't understand how the term "Document" is used in objective-C and cocoa. When I build an Application, why do I have an "Document"? That makes no sense to me. I could have an Application like an Image Editor, wherein I can open like 100 Images at same time. So every Image is a Document and has its own Nib file? Can someone explain tha...

Objective-C + Cocoa: Internationalization with Nibs. Is that really a good idea?

In the Apple Docs they say that a Nib enables internationalization by just translating the Nib into many languages. I am thinking now about a worse but realistic scenario: You have made a huge user interface. Then you translate this into 25 languages. So you get 25 different Nibs. You also get a huge redundancy in styling and defining th...

What describes the "File's Owner" best in objective-c / coca Nib?

Unfortunately, the explanation of File's Owner is pretty short at the Apple docs. I know it is an proxy object. But what's really the point about that "File's Owner" object? What is it good for? ...

Where do I find all Apple Guides for objective-c and cocoa?

I find that the xcode-builtin-documentation reader is hard to use. I want to see the root of all Guides available, to get an idea of how long I will have to keep reading until I can start. All the time some new Guide pops up to me, and I am wondering how many they are. Is there an overview somewhere? ...

Does it make sense to first learn Cocoa for Leopard and then Cocoa Touch for iPhone?

Actually I don't care too much about Mac OS X development. I want to do only iPod Touch and iPhone development. But anyways, I started learning Cocoa and Objective-C. But it seems like there are many differences between Cocoa and Cocoa Touch, so I am wondering if I am actually wasting my time. Should I just jump directly into iPhone topi...

Objective-C / Cocoa,

Let me summarize that shortly: A "First Responder" in a NibFile is an Object, which represents the UI control element that has the user's focus. So if the user klicks on an UI control, the Nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the Nib, so that I could for exam...

Objective-C / Cocoa, "First Responder" - Did I get that right?

Let me summarize that shortly: A "First Responder" in a NibFile is an Object, which represents the UI control element that has the user's focus. So if the user klicks on an UI control, the Nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the Nib, so that I could for exam...

Displaying a list of views

Here's a mockup: I have been trying to find some sample code that showcases something like this -- a scroll view with a list of custom views. Haven't found anything. I've been trying to find some open source projects that does this (that isn't Adium with a million files and lines of code), but haven't found anything there either. I'v...

Is NSTimer auto retained?

I have a -(void)save method that is called when a user clicks a navigation bar button. In that method is the following NSTimer: [NSTimer scheduledTimerWithTimeInterval:.25f target:self selector:@selector(flashBackgroundRed) userInfo: nil repeats: flashRepeat]; The timer repeats 4 times since the flashBackgroundRed keeps a count and s...

Objective-C / Cocoa: What is the "Application" proxy object in Interface Builder / Nib good for?

Does someone have a easy-to-understand example what this Application object is good for? Why is it there? And in what cases do I need it? ...

Get Return Value of NSTimer's Target

I have an NSTimer which is setup like this: [NSTimer scheduledTimerWithTimeInterval:0.5 target:timerTarget selector:NSSelectorFromString(targetSelector) userInfo:nil repeats:YES]; How can I get the return value of the timerTarget method? ...

Does Core Data exist on the iPhone? Or how would you save Data on the iPhone?

Lets say I make an App that enables users to make short notes and write things down. Is there Core Data on iPhone OS too? Or how else would you save that data in iPhone? ...

iPhone SDK: Locking the orientation

I've seen it on a previous app (forgetting the app name), where you could lock the current orientation of the screen. Is there an easy way for this to be done, for example, simply using a button. ...

The file an IconRef comes from

Is there any way to find out the .icns file an IconRef refers to or has been loaded from? Or even the id of the containing bundle if there is one? I understand that not all icons are loaded directly from a file (composite icons for example) so this wouldn't work all the time. The question I'm trying to answer is "Where does the icon th...

conceptual or technical problem with Cocoa programming

I find myself in need of access to a viewcontroller from its view. Here is the method -(void)changePageView:(UIViewController*)newviewcont withtransitiontype:(int)t andtransitionspeed:(int)s { //Remove whatever view is currently loaded at index 0, this index is only to be used by "page" views UIView *oldview = [self.view.subvie...

Objective-C "message sent to deallocated instance 0x5633b0"

I appear to have some overzealous releasing going on in my obj-C app - getting error message "-[myobj release]: message sent to deallocated instance 0x5633b0". I know the class of the object instance causing the problem, but this class is used all over to create many instances. My thought is I could put some logging in the init method ...

iPhone sdk Picasa Web Albums create Album

Hi all, I was wondering if anyone could provide a code example for creating an album? The feature is not implemented in the example code and I am having trouble implementing it. Here is the code that I have so far. GDataServiceGooglePhotos* service = [[GDataServiceGooglePhotos alloc] init]; [service setUserCredentialsWithUsername:@"myu...