objective-c

Where is the leak?

I have a memory leak in this code. I am busting it since 2 weeks and I am starting to be mad. Thanks in advance for your help :) +(void) makeEvent:(int) event:(AppleEvent *)theEvent { int sig = 'dock'; OSErr err; AEAddressDesc targetDesc; targetDesc.descriptorType = typeNull; targetDesc.dataHandle = nil; err = ...

CoreData referencing

My application is CoreData based but they may be a common theory for all relational databases: I have a Output-Input to-many relationship in my model. There are potentially an unlimited number of links under this relationship for each entity. What is the best way to identify a specific input or output? The only way I have achieved thi...

Error adding object to mutable array

for (NSString *CurrentArtistName in ArtistNamesArray) { CurrentArtistName = [CurrentArtistName stringByMatching:regEx capture:1]; NSLog(CurrentArtistName); [ArtistNames addObject: CurrentArtistName]; } why is this closing my app ? There are no errors in the coding and the NSLog is logging the CurrentArtistName ? i really ...

cannot use and object as a parameter to a method - on standard implementation

-(NSString)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component when i try to implement this method, i get the error mentioned but that seems incorrect. i have 2 questions isn't nsinteger a primitive type (not needing to be passed as a pointer)? why does the apple provided implementation...

How to recreate the animation in the Notes iPad app?

When you use the Notes iPad app (from Apple) in landscape mode, you see the list of notes to the left. If you select a note you see a nice little animation that looks like someone is marking the note with a red pencil. I already have a graphic that looks like that red circle, but how do I animate it like that? Thank you in advance. Edi...

Private instance variables - iPhone SDK

Hi all, I have a few variables in my iPhone app as class instance variables (which they need to be because they are used within multiple methods of that class. However, I don't want them to be exposed to the parent class. I have seen the @private keyword, but I am not sure if this is the appropriate use or not. Does anyone how to kee...

Saving a Video to the Photo Library - iPhone SDK

Hey guys, Is there any way for me to save a video in the Documents directory to the Photos Library? I have the link of the video in the documents directory, I just don't know how to save it to the Photos app. Thanks, Kevin ...

Get current time

How to get current time ?(hour:minute:second) ...

UITapGestureRecognizer Stops touchesEnded

I'm trying to make an iPhone app that is controlled by touch. I also want a powerup to be activated when the user double-taps. Here's what I have so far: UITapGestureRecognizer *powerRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(usePower)]; powerRecognizer.delaysTouchesEnded = NO; powerRecognizer.numb...

Kill a task after 10 seconds in Core Data

I have a function that sometimes takes too long to run. I want to attempt to run it for 10 seconds, and then just kill it if it's not done. How do I do this in Objective C on the iPhone? Creating the persistent store coordinator is failing for some users who have a lot of data in their database, because the object model merging takes to...

Cocoa __ variable names

Hey guys, I had a question about naming conventions. I noticed in alot of cocoa classes people have made, and in apples core they name some of there variables like __name is there a reason for having the __ is this something I should be doing in my own classes? If so where and when should I use it? ...

Should I dealloc @property items?

The basic rule that I have been going by is "if I alloc, I dealloc," but is this an overly simple view? ...

Expected identifier before ';' token in objective-c

I'm not sure what is wrong with this setter function declaration because the other setter functions in the same class have the same syntax and they don't cause errors. I thought it may have been syntax errors in lines before this declaration, but I've checked those too and can't seem to find the cause. Here is the code: #import <Foundat...

event characters

What event character is the return key? for example: If I used "[event characters]" and pressed "a" and then enter, what would come up? When I check it's just "a" and a space. but how would I simulate a return press in a string value? Thanks, Elijah ...

NSEvent feeding to system

Can someone show an example on how to create an NSEvent that simulates pressing return? ...

How can I use UIModalTransitionStylePartialCurl on a UIView that does NOT take up the whole screen?

In Apple's official Maps app for the iPhone, there is a small 'page curl' button in the lower-right corner. When you press it, the map itself peels back to reveal some options. I would like to duplicate this effect in my own app. I'm trying to use UIModalTransitionStylePartialCurl (Added in SDK 3.2). In terms of its layout, my app re...

Dynamically creating a UIPageControl on iPhone

I'm new with objective-c (and obviously iphone development) and I have to dynamically create UI layout of my aplication, to be more precise I have to create N (3 for example) different views which are connected with UIPageControl (link). After that, I have to add various dynamically created controls on created views. Any suggestions? som...

Sorting an NSMutableArray containing matching "pairs" of values.

I'd prefer not to change the way anArray is designed because it is also used elsewhere as a dataSource for a UITableView. The odd number values are "user names", and the even number values are their matching "dates". (The "pairs" must remain together.) How would I sort "by user name"? How would I sort "by date"? Should I be using s...

Why doesn't this bit of code work?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if ([indexPath section] == 0) { switch ([indexPath row]) { case 0: [self renameExercise]; [[self tableView] deselectRowAtIndexPath:indexPath animated:YES]; break; case 1: EditRootNoteViewController *newCo...

Rename cell's text - iPhone SDK

Hey guys, Is there anyway of renaming a specific cell's text? I know what the row number is, but I don't know how to change the cell title. Any help would be appreciated. Thanks, Kevin ...