Random C/Objective-C questions
I have come across a few lines of coding I do not understand, and would be grateful for clarification: if(!(counter&7)) ds->direction = ts->direction; Thank you ...
I have come across a few lines of coding I do not understand, and would be grateful for clarification: if(!(counter&7)) ds->direction = ts->direction; Thank you ...
I need to display 6 views and each view should display 20 items (UIButtons). I have one big NSArray which contains the items for all 6 views. For example, view 1 should be items 0-19, view 2 should be items 20-39. How would i extract the relevant range out of the array? Maybe using NSRange with a length of 20, but the start location w...
I'm currently building a user profile view. At the moment I have a table view that contains all the data but I like the layout of the apple new contact table view. I would like to have the same layout or similar layout in my app. Is this possible? and if so what can I do to get started on accomplishing this task. Currently I do have a c...
Hi, I'm using transient values to provide some data within my application. The trouble is, as soon as these values are calculated, it dirties my Managed Objects, reporting that a re-save is necessary. Is there anyway to prevent transient values from marking an object as dirty if there are no actual changes to the object graph. Thanks, ...
Okay, I am completely at a loss here. A small percentage of users seem to have BAD_ACCESS errors in my hostname translation. The complete crash below: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: 0x000000000000000d, 0x0000000000000000 Crashed Thread: 21 Thread 21 Crashed: 0 libSystem.B.dylib 0x00007fff84...
I want to overlay a HUD-style transparent graphic over the entire screen in a UITabBarController setup. The button to do this is in the first tab's screen (FirstViewController), and the overlay should also cover the tabs... is this possible? ...
hi, can you help me setting up a delegate for a UIScrollView, so I can interact with it from within it's subviews? Following problem: I added some UIViewControllers (with extra nibs) to a UIScrollView. I want to control the ScrollView from within those subviews. E.g. I want to disable scrolling when I press a button. In another threa...
Hi I am making an iPad app, it currently has multiple UITableViews named like so: monTable, tueTable, wedTable etc... I would like to have a UITextView which is editable. Then any text when the user leaves the text view it saves the chunk of text and is linked to the cell selected in the table. So when that cell is reselected the text...
Hey, I'm implementing a button class in cocos2d, and I want to be able to pass the selector when the button is created. Here is Button.m: #import "CCButton.h" @implementation CCButton +(CCButton*) buttonFromImage:(NSString*)image selectedImage:(NSString*)selectedImage atPosition:(CGPoint)position selector:(SEL)selector_method { ...
I have following code, which executes on button press. At first it works as expected but second time onwards application hangs and I get EXE_BAD_ACCESS signal. - (IBAction) comicDetailsPressed:(id)sender { static IssueProperties *props = nil; if (props == nil) { props = [ComicDataParser parseComicForUrl:@"http:/...
Hi all, I need to remove all objects from a NSMutable Array. I can't seem to do this by enumerating as the code crashes. Can anyone tell me the best way to do this with code example if possible ? Many thanks, Martin ...
When using the Date/Time picker on the iPhone/iPad, the year (yyyy) is stripped from the Date formatting in order to make room for the time. How does it accomplish this based on the default unicode formats stored by the region format? The formats do not necessarily match any of the following: NSDateFormatterLongStyle NSDateFormatterSho...
Hello everyone i need to convert this code to a function with 2 parameters in this case the first parameter is News and the second one aif can u do this ?? -(IBAction)news { CFURLRef soundFileURLRef; SystemSoundID soundFileObject; CFBundleRef mainBundle; mainBundle = CFBundleGetMainBundle (); // Get the URL to the sound file t...
I'm using an AVAudioPlayer to manage some sounds but the isPlaying method seems to be crashing. done when I initiate the page: self.soundClass = [AVAudioPlayer alloc]; how I play the sound: -(void)playSound:(NSString *)fileName:(NSString *)fileExt { if ( [self.soundClass isPlaying] ){ [self.soundClass pause]; } ...
I have the following code which is producing this error. I cannot understand why the subarrayWithRange message is being sent to a string? When it is clearly an array? static const int kItemsPerView = 20; NSRange rangeForView = NSMakeRange( page * kItemsPerView, kItemsPerView ); NSMutableArray *temp = [[APP_DELEGATE keysArray] mutableCo...
I coding app from iPad and I have to put two separate UITableView in the same screen. For this app I can´t put the UITableView and divid in two sections for requisits reason. It must be two separated. Well, in this case how I can fill the rows of UITableView. Can I have create a DataSource and Delegate in separate classes, one for a firs...
I've noticed some weird behavior with NSBundle when using it in a command-line program. If, in my program, I take an existing bundle and make a copy of it and then try to use pathForResource to look up something in the Resources folder, nil is always returned unless the bundle I'm looking up existed before my program started. I creat...
I'm developing an iPhone app that is a "module" of another launcher (it doesn't launch from the iPhone home screen). To add this module to the launcher, I have to drop in the xcode file into the parent xcode project (creating a subproject). The subproject uses a NIB file as its view controller and the subproject loads the file using init...
I'm creating an app that constantly checks the number of views a youtube video has. Is this possible? and how would I do it? Example code, would be awesome :D Thanks, Elijah ...
Hi I know this must be asked a millions times and can't be easy to answer as there is o definitive method, but any help would be appreciated, thanks. I have been playing around with all sorts of things in Xcode and with Objective-C, however I can't seem to find a good way of learning things in an efficient way. I have bought the book ...