objective-c

NSOpenPanel in iphone sdk...

Hi All, I am trying to follow apples XMLParsing for the iphone SDK, but getting in a right muddle around this NSOpenPanel. It appears to be in the mac os framework, but how can i use it as it suggests int he dev centre for the iphone? Any suggestion welcome... ...

Are there any good 2D UITableView like implementations out there?

So what I'm looking for is a table view that supports and displays an array of cells (think excel). The 2D implementation should have cell caching for performance, optimized for panning. ...

Is there anything wrong with my code?

-(void)processGlyph:(int)glyphOne withGlyph:(int)glyphTwo { answer = glyphOne + glyphTwo; NSString *tempText = [[NSString alloc] init]; tempText = [NSString stringWithFormat:@"%i",answer]; [self dispatchText:tempText]; [tempText release]; } -(void)checkReadyToProcess { if (count >= 2) { [self processGlyph...

textViewShouldBeginEditing for UiTextView is called twice (one after another)

hi, the textViewShouldBeginEditing` is called twice, one after another. i have no idea as to why. the only thing that i can tell is that once i have updated the text property of the UiTextView, by textViewName.text = someText; then the next time if i click on the TextViewName the method is called twice. i commented out the above code...

Application Design - Differences between iPhone and Cocoa applications?

In iPhone development for every page you see there are 2 files, a nib file, and a view Controller (books.nib, booksViewController.m), but in a Cocoa application apple suggests to have 3 files (books.nil, books.m, booksViewController). What is the point of having 2 class files? is it a bad idea to connect the attributes to the outlets in ...

How can I make all Core Data objects inherit from my class rather than NSManagedObject?

I created my own class that I want Core Data to use instead of NSManagedObject: @interface MyManagedObject: NSManagedObject { id delegate; } I can't use a category since this declares an ivar. All of my Core Data objects use concrete classes rather than being instances of NSManagedObject. I use the code generator to generate these f...

Loading data in Views depending on MapKit annotation callout click

I have a map with a disclosure button on the callout of it's annotations, which when clicked displays a detail view. Each point on the map needs to load up different data in the detail view - I dont want to build separate views for each annotation, for obvious reasons, but I am unsure of the best way to do this. How do I flag which ann...

Objective C syntax question...

I see that the UIColor class can call the variable like this [UIColor redColor]; How can I write my class to do the same thing? Also, can I have a method only for class, for example, like this: [MyClass callingMyMethod]; Thank you. ...

object position relative to a different subview

I am thinking about creating a Game Board view with an array of subviews to form slots for tiles. I plan to have tiles that I can drop onto the board and have them snap into position. The part I am unclear about is when I drop my tile and the touchesEnded event fires, what is the best way to loop through the subviews of my Game Board to ...

Storing and retrieving C struct in NSMutable Array

I have the following C Struct defined : typedef struct { float x; float y; float z; } metric; I want to store accelerometer points in an array and do something with it later. So I have a mutable array that is initialized like so in my viewDidLoad method : metricsArray_ = [[[NSMutableArray alloc] init]retain]; in my di...

Why is my tableHeaderView disappearing

I'm having a strange issue with a table header disappearing after dismissing the keyboard. Here's the how the problem occurs: Select the textfield that is a subview of the table header view. Keyboard shows up as expected. Scroll the table so that the header view is off-screen. Press the return key, which dismisses the keyboard, and tel...

Classes deleting Variables? iPhone SDK

I have been having some problems with some variables inside a class being deleted lately. Here is how I declare: MyClass *myClass; -(void)viewDidLoad { myClass = [MyClass new]; //something using my class then when I call a function later that uses an array and a dictionary inside the class. [myClass doSomething]; Here is the code I...

Objective-C 2.0 is not working in GNUstep

[GNUStep installers] gnustep-system-0.24.2-setup.exe gnustep-core-0.25.0-setup.exe gnustep-devel-1.1.1-setup.exe gnustep-cairo-0.22.1-setup.exe I installed them to windows 7. But, it is not able to use Objective-C 2.0 syntax. Example, @property, @synthesize, assign, and so on. And, I want to use CFSocket, but CoreFoundation was not su...

NSUrl bookmark data

what part of NSUrl has the bookmark query? eg: mypage.htm#part1 how can i get #part1? ...

How do I persist CLLocation between app launches?

Hi there, I want to persist 2 CLLocations between app launches. This is the ONLY data I want stored in memory between launches. How do I go about doing this? Does CLLocation have a writetofile or store it in coredata or NSUserDefaults? I want to store the whole CLLocation object, don't want to store only lat/lon and then do more calculat...

Why do I keep getting "so and so is undeclared" error messages?

This is my first time working with Objective-C, and I keep trying to create objects of classes I have created in methods of other classes, and it will not work. What I mean is for instance, I will have one main class, and one of the methods does something like this: exampleclass *instance1 = [[exampleclass alloc] init] And it says t...

How do I change modalTransitionStyle?

I am currently using this code to bring up an info window -(IBAction)showInfo:(id)sender { InfoView *info = [[InfoView alloc] initWithNibName:nil bundle:[NSBundle mainBundle]]; [self presentModalViewController:info animated:YES]; [info release]; } It currently uses the default transition style, UIModalTransitionStyleCoverVerti...

Drawing figures on context take time

I am using CGContext to draw figures on it(e.g. rectangle,ellipse,line,polygon) code: rect = CGRectMake(10,10,10,10); mWBContext = [[NSGraphicsContext graphicsContextWithWindow:[self window]]graphicsPort]; CGContextFillRect(mWBContext,rect); It draws the rectangle but take some time.sometimes it may be 2 mins sometimes ...

Dragging pasteboard is nil when remote debugging from Xcode

I'm writing an app that needs to work in both 10.5 and 10.6 (We still have PPC machines). My development machine is 10.6.4 with Xcode 3.2.3, and I have a 10.5.8 machine with Xcode 3.1.2 on it. I use remote debugging to test out the app on the 10.5.8 machine, and I've run into a problem with a Drag and Drop method that only occurs when r...

A Simple Objective C xcode Memory Management Question

In the code below, will tapsLable.text be deallocated when tapsMessage is released or does the assignment operator somehow increment the retain count so that tapsLabel.text continues to be available? NSString *tapsMessage = [[NSString alloc] initWithFormat:@"%d taps detected", numTaps]; tapsLabel.text = tapsMessage; // tapsLabel is a UI...