objective-c

Objective-C tab settings and whitespace style

Apple's Objective-C documentation, references, and generated code seem to be totally inconsistent with their coding style. I can not determine the "preferred" style (if one exists) for Objective-C and Cocoa source code. Here's what I've ran into so far. Tab settings Xcode's default setting is set to tabs. However, generated projects ...

How to wait for an animator to finish?

This is probably a simple question but I can't seem to figure out how to do it. Basically all I want to do is fade a window before closing it: [[window animator] setAlphaValue:0.0]; [window close]; This works fine without the [window close], but when that is included the window seems to close it before the animation finishes (which is...

Design an NSView subclass in Interface Builder and then instantiate it?

So I have an NSTabView that I'm dynamically resizing and populating with NSView subclasses. I would like to design the pages in IB and then instantiate them and add them to the NSTabView. I got the programmatic adding of NSView subclasses down, but I'm not sure how to design them in IB and then instantiate them. ...

UIImageView Zoom in and out

Hi... I want to change the images depending upon the zoom in or zoom out. Means if i am zoom upto certain limit then it should show other image. I added one UIImageView in UIScrollView and zoom in and out functionality is working but i am not getting how to change image during zoom in and zoom out. And while changing image it should h...

Learning Objective-C

I am using Windows and would like to learn Objective-C. I installed Gnustep and was unable to determine how to construct and build a project (equivalent) nor could i find an IDE (see here if you have a suggestion) Are there any alternatives? (I saw this but i am fairly sure my question is different enough to warrant a separate question) ...

Work with wifi in my iphone application

Hello everybody! Please answer me, How to obtain information about wifi networks in my iphone application, Does apple provide API for this, Can I change current wifi connection without exit from my application? ...

Parsing XML file using NSXMLParser

Hello I have to parse an XML file using NSXMLParser. There are so many HTML tags in them, so when I am trying to parse it, it will store the string up to that and then again go to found character method and starts to append it. my code is: if (Bio_CResults) { [BioResults appendString: string]; [Info appendString:string]; [stringar...

access an integer and string globally in iphone?

i want to access a integer and a string from a class to all the other classes? what is the best way to do it? i want to increase the values any where in the program and then want to update them in the class declared.... any idea how to achieve this??? ...

Objective C Warning: passing argument 1 of 'touchesForView:' from distinct Objective-C type

I'm using some code from here to determine when determining when the last finger in a multi-touch sequence has lifted. Here's the code: /* Determining when the last finger in a multi-touch sequence has lifted When you want to know when the last finger in a multi-touch sequence is lifted from a view, compare the number of UITouch object...

NSImage vs. CIImage vs. CGImage?

When should I use each? ...

Sound format for iPhone app

What kind of audio files are you using in your iPhone games/apps? I have a game with 30MB of sounds in .wav format and I'm thinking of maybe converting to .mp3 to reduce the app size... Is there a major difference in performance? Any other issues? ...

Detect if one position in Array is already initiated

I need to check specific positions in an NSArray to see if they have already been initialized, but I am having trouble. I tried to do the following, but it causes my application to crash! if ((NSMutableArray *)[arrAllBlocks objectAtIndex:iLine] == nil) { [arrAllBlocks insertObject:[[NSMutableArray alloc] init] atIndex:iLine]; } NS...

Classes are also objects in objective-c, how does this differ from C#?

Classes are also objects in objective-c, how does this differ from C#? (if it does). ...

Where's the memory leak here?

Instruments tells me there's a mem leak in this code, but I can't seem to find it....any help? sorry or the newbie question. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { int altoBufferCelda = 26; Mensaje *msg = (Mensaje *)[model.mensajes objectAtIndex:indexPath.row]; CGSiz...

Generating forms from models (a la django ModelForms) in Objective-C

I'm taking the plunge into iPhone development after about two years working with django. As I've done tutorials and read documentation, one of the things that strikes me as inconvenient about the various libraries used in iPhone development is the amount of repetition required when creating user input forms for data models. I know of...

Audio recording error kAudioQueueErr_CannotStart on iPhone OS 3.0

I'm working on a couple different iphone apps that both record and play sounds concurrently. Think multitrack mixing... play one sound a save it then listen to that sound while recording the next sound to another file. My mechanism for this has been to start up two different audio queues, one for recording, and one for playing. This w...

Beginning OS X & iPhone Development: Reference texts

My programming experience is limited to xhtml, css, php, sql and some javascript. The books I have are: Programming in Objective-C 2nd Edition Beginning iPhone Development Cocoa(R) Programming for Mac(R) OS X (Paperback) Is there anything else I will need to get started on my journey into iPhone/OS X development? ...

Indexed Relationships in Core Data

I'm just starting out with using Core Data on the iPhone SDK and I'm looking into saving an ordered list, something like an array. However, relationships in Core Data are expressed as Sets when retrieved. This makes it difficult to save the order in which the objects are positioned. A good example would be data items in table view when...

Resources for Unit Testing Cocoa Applications

I'm looking into unit testing and TDD for a Cocoa desktop application and I'd like to find some code examples. I am aware of Chris Hanson's excellent articles, but I'd like to crowdsource finding some examples of actual tests in a code base. ...

Objective C - Remove last character from string

In Objective C for the iPhone, how would I remove the last character of a string using a button action. ...