objective-c

How to use Calibri font?

I want use Calibri font for to display a text in a label. Can any one help how to use Calibri font. Thanks in advance. ...

Unknown iPhone Control - Help me out

Hi can anyone let me know which control they have used for doing the scrolling. I like that control very much. http://www.youtube.com/watch?v=Ssa2k4RlYXs&feature=channel Application is free to download. Help me to figure out which control is this. Application URL: itunes.apple.com/us/app/xix-cwg/id353382539?mt=8 Help me out. Co...

sample code to get extra two rows based onlist count.

I need to two extra rows.I am having list count 20 but, I need to display row count as 22.I need extra two rows using UITableview in object-c. Thanks in advance. ...

Send copy of class to view class so it can render him? ( iPhone )

I'm making a game for the iPhone, and I have a class called Robot. Then I have a class called View, which renders everything. I want to send a copy of my Robot, which I defined in my ViewController, and I send it to gameView (which is View *gameView), like this: robot = [Robot new]; [gameView setRobot: [robot copy]]; I tried to make...

Objective C Class or struct?

I have a class Song with properties Title, Key, Artist, etc. There are no methods. I loop through a database of song information and create a Song object for each, populating the properties, and then store the Song objects in an NSArray. Then I thought, why not just have a struct Song with all those same properties instead of a class So...

XCode Project Code Changes Not Updating 100% After Save-Build-Run

When I make code changes to my iPhone game project in XCode, and then do CMD-B + Enter, I expect the project to be saved, build and run on the simulator with the latest. What is happening though, sometimes, is that it doesn't pick up a small change I make unless I clean the project and then build. I'm a long time Java person and newish...

Why do I have memory problems?

I got this error from XCode: objc[8422]: FREED(id): message release sent to freed object=0x3b120c0 I googled and find that is related to the memory. But I don't know which line of code I go wrong, any ideas? After I launch my app in simulator, it prompts a second, than, no other error except the error above. @implementation MyAppDele...

Objective-C categories in static library

Can you guide me how to properly link static library to iphone project. I use staic library project added to app project as direct dependency (target -> general -> direct dependecies) and all works OK, but categories. A category defined in static library is not working in app. So my question is how to add static library with some categ...

Why is sysctl producing E_INVAL on Mac OS X?

Below is a pared-down (error/null checks omitted) snippet of C/Obj-C code that uses sysctl to get the argv of a particular process with PID 50. ... int getProcessArgs[3] = { CTL_KERN, KERN_PROCARGS, 50 }; sysctl(getProcessArgs, 3, NULL, &length, NULL, 0); char* processArgs = malloc(length * sizeof(char)); sysctl(getProcessArgs, 3, proce...

Can't get iPhone device token

Hi. I'm trying to get iPhone device token using following code - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:viewController.view]; [window makeKeyAndVisible]; NSLog(@"Registering for push notifications..."); [...

Does Quartz2D test intersection of rect by line before drawing it.

I'm drawing a big scheme that consist of a lot of lines. I do it in the drawRect: method of UIView. The scheme is larger than the layer of view and I check each line and draw it only if it intersects the visible rect. But at one moment I thought, should I do this? Maybe Quartz is already doing this test? So the question is: When I use f...

Heterogeneous NSTreeController

I have an NSTreeController (supplying content to an NSOutlineView). I'd like the top-level objects to be of one class, and all other objects (so, children at any level) to be of another. What's the best way to go about this? I'll need to somehow change the behavior of at least add, addChild, insert, and insertChild, I suppose. I was hop...

What languages besides Objective-C will generate application code that works on an iPad?

I would like to write an app for the iPad but I can't stand Objective-C. Is there a language generator that would spit out Objective-C but let me write my iPad application in another language? I've heard a little about MacRuby and am curious whether it could be used this way. Any other similar projects in other languages? ...

NSURLConnection POST also calls GET of same URL.

Hi all, I have a NSURLConnection which is a post to the server, but I expect it to return some small data, whether it was successful or not. -(void)submitPost:(NSString *)xml { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[service generateURL]]; NSString *result = (NSString *) CFURLCrea...

Objective-c garbage collection

If garbage collection is not required: - (void) awakeFromNib{ //Create the NSStatusBar and set its length statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain]; ... Do I have to release that? And if I do, would that be in a finalize method or dealloc method? If garbage collection is requ...

UITabBar customization

This looks like a long shot, but does anyone know of a way to: Position a UITabBar on the top part of the screen Change it's height You are welcome to suggest private API methods ...

Problem with cell background in UITableViewCell

I have a full list that populates a UITable. This I want to background the one of the cells with a different color and it works initially, but for some reason when I start scrolling the table up and down, it starts drawing more cells with the green background. Please note that there is ALWAYS one detailCell.detailTimeLabel.text that's ...

How does ps show the argv for all processes on Mac OS X?

I'm trying to identify when a particular process is running, based on its arguments, on Mac OS X. There may be several processes running with the same name, but only one will have the arguments I'm looking for. The processes are not owned by the same user who will be running my code. They will not have modified their argv in any way. ...

Make sense of Notification Watcher source objective-c

From Notification Watcher source. - (void)selectNotification:(NSNotification*)aNotification { id sender = [aNotification object]; [selectedDistNotification release]; selectedDistNotification = nil; [selectedWSNotification release]; selectedWSNotification = nil; NSNotification **targetVar; NSArray **targetList; if (sender == distNotifica...

Objective C - when should "typedef" precede "enum", and when should an enum be named?

In sample code, I have seen this: typedef enum Ename { Bob, Mary, John} EmployeeName; and this: typedef enum {Bob, Mary, John} EmployeeName; and this: typedef enum {Bob, Mary, John}; but what compiled successfully for me was this: enum {Bob, Mary, John}; I put that line in a .h file above the @interface line, and then when I ...