objective-c

Is there a way to enforce runtime type-checking in Objective-C on Cocoa?

Hi I'm finding a way to enforce runtime type checking or such things in Objective-C on Cocoa. This is my code sample. I expected runtime error about wrong assignment to variable 'b'. But it wasn't. Compiled and executed without any error. #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePoo...

Animating "sliding" in NSOutlineView

I've done a fair amount of Googling, but still haven't find any proper solution for animating the expansion of NSOutlineView. I'm trying to mimic a "sliding" animation when expanding/collapsing rows. Anyone know a good strategy for attempting this? Animating this: }} Folder 1 To expand and look like this: }} Folder 1 }}}}} Item 1 ...

Center & No repeat View.BackgroundColor (Iphone)

Hi, I put a background in my view like this: UIImage *picture = [UIImage imageNamed:@"myImage.jpg"]; self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:picture]; The problem is my picture is not big enough for the screen, so it repeat many times and its also not center in the View. How can I change that? Than...

Mapping data from RSS feed with no latitude/longitude using MapKit

Having follow the tutorial at http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ to integrate the MapKit into my application. However, I want to be able to display an annotation for a dynamic "incident" on the map. Here's where I'm having problems. Basically my apps an RSS reader, and it downloads everything and s...

NSIndexPath warnings in Obj-C

Hi All, I am getting a warning while creating the NSIndexPath, NSInteger arr[] = {0,3}; [NSIndexPath indexPathWithIndexes:arr length:2] warning: pointer targets in passing argument 1 of 'indexPathWithIndexes:length:' differ in signedness What is the warning due to ?? How to make it work? Thanks ...

custom number pad

I want to create my own number pad to appear after user focus the textfield, so I have two question about it? 1.I use "Interface Builder to add a textfield in my view and select the "Number Pad" as the default pad for user to input number, so when I click the textfield, the number pad appear automaticlly, how can I stop it appear the num...

converting Biginteger to Bytearray(Raw data)

Hi i have used the following code for converting the bigint in decimal to bytearray (raw data) , but i am getting wrong result What is the mistake here. I am trying this in Apple Mac ( for Iphone app) COMP_BYTE_SIZE is 4 Is there any bigendian/ little endian issue , please Help. void bi_export(BI_CTX *ctx, bigint *x, uint8_t *data, i...

Cannot see void procedure in implementation

Hello I have a method SetBallVisibility declared in the interface for my view controller. However, I get an undeclared identifier error when I try to use this in the implementation. What I am I doing wrong? Interface @interface TimeFrameController : UIViewController { IBOutlet UILabel *lblTime; IBOutlet UIButton *btnTimeout...

Core Data Store Sharing between iPhone Apps

Hi, Is it possible to share a core data store between two different iPhone apps signed by the same developer? I would like to develop an application where one iPhone app will save a stream of data, which can then be read by the other app. Is this even possible? Thanks a lot! ...

Navigation stack monitoring

Can anyone tell me why this comparison keeps making my app freeze and crash? NSArray *viewControllerArray = [controlFromMap.navigationController viewControllers]; NSUInteger parentViewControllerIndex = [viewControllerArray count] - 3 // or - whatever; NSLog(@"Parent view controller: %@", [viewControllerArray objectAtIndex:parentViewCont...

Objective-C NSThread ref counting convention (retain vs autorelease)

My main program spawns a thread, which executes the following: // alloc autorelease pool somewhere before NSArray *blah = [NSArray arrayWithObject: @"moo"]; [self performSelectorOnMainThread: @selector(boonk:) withObject: blah waitUntilDone: NO]; // release autorelease pool somewhere after Now, this seems buggy to me because the...

Interface Items in ChangeViewController.xib do not show up when run

I add items in Interface Builder to the XIB but then when I run it in the iPhone Simulator, I just get a gray screen. Then for some reason, if I go to the Interface Builder, draw "View" and then paste my items inside it, the items suddenly work fine. ...

NSTableView. How to override autoscroll behavior?

I've got an NSTableView that displays (via bindings) data from an NSTreeController. The application frequently appends/changes data to/in the bound array. The problem is that if the user has selected a row in the table, but has scrolled so that the selected data is no longer visible, when the application updates the array it causes the ...

Problem with UIViewController orientation

I'm writing EAGLView - based application (game) and need to add UIViewController with UIWebView in landscape mode. What I done: Specified UIInterfaceOrientationLandscapeRight for UIInterfaceOrientation in the Info.plist Call [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO] in the applicationDidFi...

Programmatically open PrefPane with section

Hi All I need to open the network-prefpane in my App. This works fine with [[NSWorkspace sharedWorkspace] openFile:@"/Path/To/PrefPane"]; But how can i directly open the "proxy-settings", which is in the "network-pref" under "advanced"? You can see this in the Safari-Settings under "Advanced->Proxies" Thanks ...

MPMoviePlayerController play video second time

I need to have the possibility to play more than one video in an app. Unfortunately, the second time I press play, video appears blinking. I use only this code for playing vide NSURL *url = [[[NSURL alloc]initFileURLWithPath:[[NSBundle mainBundle]pathForResource:@"Movie" ofType:@"m4v"]] autorelease]; MPMoviePlayerController *...

Doxygen and Objective-C categories

Although the latest releases of Doxygen claim better handling of Objective-C categories, it still seems to choke on categories in my source code. I'm wondering if someone has gotten it to document categories properly. As an example, I have a category on NSString defined as: @interface NSString (CCFExtensions) with an interface file ...

Successful Swipe in UITextView?

Has anyone been able to implement a successful swipe gesture on a UITableView? By default this is not possible due to the scrolling nature of the control. I've tried subclassing UITextView and implementing the swipe function in the instance methods, but no dice. My UITextView has scrolling disabled - Unless there is another way to imple...

Help With Intra-Application Drag and Drop -- Cocoa

Okay, I've got a custom class called "Task", which represents a task to be done. I've got an NSMatrix which acts as a calendar. I want the user to be able to drag an icon from an nscollectionview (I've had no trouble setting up the nscollectionview) onto a cell in the nsmatrix, thereby assigning that task to that day. I just can't see...

How to add the % symbol directly after a variable call in Obj C?

I have a program that calculates some user input, and I would like to show it as a percent. I just need to know how to put the '%' symbol in my code without it crashing on me. Using, lblUserTypedName.text = [[NSString alloc] initWithFormat: @"%2.1f", ultimate_risk]; Prints out a number, like 18.4. I would like for it to print out 18....