objective-c

Is there a way to make a CGPath grow by x Pixels?

I'm building a custom UIView, which draws its own content in a drawRect: Method. I want to stroke a CGPath with a color, and then grow this selection 1px and stroke with another color. Has somebody worked out a method to do this quite easily? ...

How do I Retrieve Relative Scores From a Subset of Entities in CoreData

Hi all, Sorry for the long question but I think it needs some background :S I have the following model in CoreData: A Guest can have any number of Scores in its scores relationship. A Score can have a maximum of two Guests in its guests relationship. For each pair of Guest entities I model have a Score entity with a value indicatin...

URLCache - iPhone SDK

Hello everyone.. I need some help in using the NSURLCache to download a simple file. It would need to be saved in the Documents folder of the app. I have seen the URLCache example that apple presented, but I didn't find it useful since it was an image that was being shown. In addition there was some complex code on the modification date...

iphone image is leaking, but where?

the image that is being displayed in this code is leaking but I cant figure out how. What I have a tableview that displays images to be displayed. Each time a user selects an image, it should remove the old image, download a new one, then add it to the scroll view. But the old image is not being released and I cant figure out why... -(...

Editing Mac OS X login items in Objective-C through AppleScript

In my Cocoa program, I want to examine what programs are registered to run at startup and modify that list as I feel appropriate. In order to be compatible with Tiger it seems like I need to work through AppleScript. I currently have the following code: NSDictionary* errorDict; NSAppleEventDescriptor* returnDescriptor = NULL; NSStrin...

Getting better at drawing in code for Cocoa?

Hi, What are some suggested "paths" for getting better at drawing in code in Cocoa? I think at this point, that's my biggest weakness. Is drawing in code something general, or Cocoa-specific? Thanks! - Jason ...

Force a GNUstep "bundle" to be executable

Does anybody know how to get GNUstep-make to compile a bundle but make the resulting binary executable? ...

NSOutlineViewDelegate - need something like didFinishEditing

NSOutlineViewDelegate has outlineView:shouldEditTableColumn:item: which gets called before editing a cell. I need a similar method called after the user has finished editing a cell (in order to trigger some calculations). Where should I look for this event ? ...

which iphone data model to choose?

i need to get some data somewhere to put in a timeline. the data strcture is like this: - Item - Name - Year - ShortInfo (mainly keywords and short texts) - LongInfo (much text with videos/audios (urls) a friend of mine told me i should you a plist and get all that stuff in there, but what about a sqlite database? any advice? ...

Set Autolock programatically

hi friends, I want to set auto lock my iphone/ipad/ipod screen programaticaly after some time delay. Can any one tell me how to do the same? if any one is having any suggestion please let me know. thanks in advance. ...

iPhone: Pushing View Controller causes Slow and Jerky Keyboard Animation

I have a model-view-controller design app with more than 20 views and imageviews. In one view, I have a textfield that gets set to first responder when the view displays such that the keyboard is immediately visible. When I push this view onto the navigation controller the display of the keyboard is very slow and jerky. However, when ...

Dynamically populated NSPopUpButtonCell menu in an NSOutlineView

I’m working with an NSOutlineView which has two columns. My dataSource supplies the outline view with a tree of items of a custom class which represents file types (that is, you initialise it with a UTI). The first column is the display name of the file type (e.g., “Source code”, “Interface Builder NIB document”, etc.). The second column...

iPhone Pong Advanced Deflection Angle

Hi, I am currently developing a simple Pong game for the iPhone. Currently using CGRectIntersectsRect for the collision detection and as for the deflection of the ball when it hits the paddle, I just multiply the ball velocity with -1 (therefore reversing the direction of the ball). What I am trying to do is to make it so that when the...

Should I use performSelector: when I also can call the method normally?

Hi, I want to call a method on an object which I get through [self delegate]. I know which class it is so I can import the class and call it normally but I could also use performSelector: which doesn't require importing my class. I do not need to pass a parameter to the method. And yes, I did read this. Which one is preferable in this c...

iPhone: Creating a hierarchy-based table navigation.

Hi there, I've tried to ask this before, but nothing got answered. Basically, I would like someone to explain to me how to create a table, which when a cell is tapped, pushes the user to the next view for that cell. I have this so far: Click here to view what I have. I would further like to, say when CSS is tapped, it goes to a new vi...

Returning from method inside a @synchronized block

I'd just like to know if it's advised to return from a method within a @synchronized block? For example: - (id)test { @synchronized(self) { if (a) return @"A"; else return @"B"; } } As opposed to: - (id)test { NSString *value; @synchronized(self) { if (a) value = @"A"; else value = @"B"; } re...

NSDictionary with specific property of plist

Hi, I have a plist with key values. Each key represent a language, let's say 'it' 'en' ....ecc The value of each key is another key/value(=array) set. At startup I would like to create a dictionary by reading only a specific key. Let's say the locale of my iphone is 'it', then the init method would only parse it key, because the only w...

translating Ecmascript (Java,javascript,Actionscript) knowledge to Objective C

Hi Newcomer to Objective C and trying to translate concepts and sytax I know from ecmascript based languages to Objective C. Is it proper to think of the .h header file in ObjectiveC as an Interface in Actionscript? Lets take the following code example in Objective C which calls a method containing 2 arguments [myTextObject setString:...

Display Text From a Document's File - iPhone SDK

Does anyone know how to display a text file, if its in the "Documents" folder of the iPhone application? The extension might not always be ".txt", but I would like to give it a try. Thanks, Kevin ...

Difference between writing to file atomically and not

What is the difference in writing to files atomically on the iPhone in objective-c and not, is there any performance difference between the two? Thanks in advance! ...