objective-c

Why am I getting an isEqualToString error in this Cocoa code?

I keep getting this error: What is it? I never even called "isEqualToString". Here Is my Joke.M @implementation Joke @synthesize joke; @synthesize rating; - (id)init { [super init]; return self; } - (void)dealloc { [joke release]; [super dealloc]; } + (id)jokeWithValue:(NSString *)joke { Joke *j = [[Joke alloc] init]; j.joke =...

How to debug an objective-c program (pbcopy supplied by Apple) with gdb?

Hi everyone, I need to debug an objective-c program. When setting a breakpoint on main() function , I've got: Reading symbols from /usr/bin/pbcopy...done. (gdb) break main Function "main" not defined. Invoking "start" from reply the same error. I suspect the way of doing things is different on max os x ? What is the equivalent with o...

Understanding Objective c enum declaration

From iPhone UIControl UIControlEventAllTouchEvents = 0x00000FFF, UIControlEventAllEditingEvents = 0x000F0000, UIControlEventApplicationReserved = 0x0F000000, UIControlEventSystemReserved = 0xF0000000, UIControlEventAllEvents = 0xFFFFFFFF Now I assume the UIControlEventApplication is the 'range' I can use to spe...

Getting UUID through SDK

Does the SDK provide an API for retrieving the current phone's UUID? ...

Why isn't there NSArrayController for the iPhone?

Why isn't there NSArrayController for the iPhone? Will there ever be an NSArrayController for the iPhone? ...

What is the alternative to excessive use of the dot operator in Obj-C?

See what you think of this line of code: if ([pickerViewController.picker.bvc.currentResolve.name isEqualToString:message]) ... Would you consider this to be excessive use of the dot operator? If not, I can leave it as-is. But if so, what's the preferred alternative? ...

Iphone Object C - Data,Objects and Arrays

So I'm a Flash guy and I'm trying to convert the following code to Object C: var slot:Object = new Object(); slot.id = i; slot.xPos = 25*i; slot.yPos = 25*i; slot.isEmpty = False; // push object to array arrGrid.push(slot); Later I can override like: arrGrid[0].isEmpty = True; I can't ...

How does one properly lay out a standalone system service in Xcode?

I've recently become interested in writing some system services for OS X but since I have no application to advertise the services under I must resort to writing standalone system services. Apple's documentation on System Services is spartan as it is, but its documentation on standalone services is non-existant. What I have thus far is ...

Core animation anchor point being ignored?

This code: (self is a subclass of NSView) rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; rotate.duration = 5; rotate.toValue = [NSNumber numberWithFloat:(2*pi)]; rotate.repeatCount = INFINITY; rotate.removedOnCompletion = NO; rotate.fillMode = kCAFillModeForwards; NSLog(NSStringFromPoint(CGToNSP...

Why am I getting an error for this?

Why am I getting these errors? It says: Error: Request for member "jokeTableView" in something not a struction or union What does that mean? And why is it breaking. I tried reading about initWithStyle but I just could catch up on it Here is my .h file: #import <UIKit/UIKit.h> @interface TableViewController : UITableViewContr...

Existing implementation of cropImage:to:andScaleTo: and straightenAndScaleImage()?

I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on SO related to cropping and scaling. However, it doesn't have implementations of cropImage:to:andScaleTo: nor straightenAndScaleImage(). Here's how they're used: newImage = [self cropImage:originalImage to:croppingRect andScaleTo:scaledIma...

When to use self on class properties?

When is self needed for class properties? For example: self.MyProperty = @"hi there"; vs MyProperty = @"hi there"; MyProperty is an NSString set as (nonatomic, copy). Is there any difference in memory management for the above two? What about when there is no property and the variable MyProperty is declared in the header file? I...

Basic Obj-C question: Calling methods on an object

Background: I'm a .NET guy who has no prior experience in Objective-C/Cocoa, but I'm working through Aaron Hillegass' book, "Cocoa Programming for Mac OS X" trying to pick up the basics. (Great book so far, BTW!) For the purpose of completing one of the optional side challenges, I'm writing a document-based app that lets users draw ovals...

Is there a way to use C++ for iPhone development?

Sorry if this is mentioned somewhere, couldn't find any info about it. Post a comment if you find a duplicate. This is not about whether it's possible at all to compile a C++ program for the iPhone (which I suppose is possible). Basically the question is, can you bridge between Objective C and C++?, and if it is possible, would it be f...

How i calculate loading time of a application in iPhone?

I want to add a loading bar at the initial of the game which is customized loading bar. for that i need to calculate the loading percentage to show loading progress. Is there any way to calculate the loading time of the application? please help me. If i add Default.png in my resources folder, it will seen at the time of application load...

How is the market opportunity for objective-C

I am a software testing automation engineer. How is the market for objective-C. I am assessing different technologies and languages to learn and later shift into. How are the oppurtunities for objective-C and what is the best way to get into it ? ...

memory issue in iphone?

I am using single UIImageView object, allocated memory it once. But changing the image names multiple times. The question is that, A) one UIImageView object,allocated once and never changed image name. e.g UIImageView *firstObj = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"blue.png"]]; B) another UIImageView object,allo...

How can i find out the accelerometer direction?

I doing a sound application on accelerometer.Its play different sound for movement by calculating accelerometer value.But how can i find the accelerometer direction that the user move x-axis plus or minus and y-axis plus or minus.How can i find this value on accelerometer. Please give some instruction or helping code or project. ...

How can I get the size of an array in C / Objective-C?

I have this array: unsigned char* data = CGBitmapContextGetData(cgctx); then I tried to get the size with sizeof(data), but that will return me a nonsense-value of 4. data holds a big amount of information. That can't be just 4 ;) I even get information at data[8293] ... so ... not 4 elements at all. ...

How can I make a set of constants, to improve the usabilty of my methods?

I've written an method that does some graphics calculations. There, you can specify a start-direction like "from left", "from right", "from bottom", "from top". Now I don't want the user of my method to pass confusing values like 1, 2, 3 or 4 or even strings. Nothing like that. Instead, I would like to create constants like: kFromLeft,...