objective-c

coreplot build error in CorePlotProbes.h after installing snowleopard

I downloaded the core-plot framework and tried using it after installing snow leopard. I ran one of the examples but it failed to build - 101 errors - most of them something to do with a stray error in a file named CorePlotProbes.h. screenshot: http://img443.imageshack.us/img443/8577/screenshot20100608at411.png Any clues? ...

Adding nil to NSMutableArray

I am trying to create a NSMutableArray by reading in a .txt file and am having trouble setting the last element of the array to nil. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"namelist" ofType:@"txt"]; NSString *data = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; NSArray *list...

How do I shut off the Mac screensaver?

I'm writing an application that uses Apple's kiosk mode. I would like to disable the screen saver, but the "ScreenSaverDefaults" class reports itself as being 32-bit only. I can change the build to be 32-bit only, but I would like to be able to support 64-bit architectures as well. Are there any other Frameworks that I should use to d...

How to create a UIScrollView Programmatically?

Alright, so the key here is I'm not using IB at all, because the View I'm working with is created programmatically. The UIView covers the lower half the screen, and has a bunch of buttons on it. However, I want to add more buttons to the UIView, without making it any larger. To do so, I want to make a UIScrollView inside the view, whi...

how to add the menu button in the UIDocumentInteractionController class method for ipad.

i want to add the menu button in the document file to open it in the other app ,how to add the button in the menubar to open it in the other app. how can i use this method for that- (BOOL)presentOpenInMenuFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated if anyone know pls answer the question. ...

Advice on the aproach for a native iPhone that emulates a web application

Hi, I need your advice. We have an already working web resource management application, we use the usal tools html, css, php, mysql, the users logs in, create a new issue and data is saved/retrieved in/from a sever, everything ok. The thing is that they ask me to develop an iPhone app using objective-c to emulate the functionality. No...

Help - Three20 Distribution Build

Hey there, I just wanted to build my App for submitting it to the AppStore - it includes the widely used three20 framework. As the Debug Versions on the Dev-Devices worked great, i'm having trouble compiling the project for distribution. XCode says: No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv6, VALID_AR...

Memory consumed by an object during its lifetime

How can i trace memory consumed by an object in its life time when i am testing my application on device? [e.g.: without any instruments if possible] ...

Objective-c: Comparing two strings not working correctly.

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section]; if(tempArray != nil){ for (int i = 0; i < [tempArray count]; i++) { if([[sectionInfo indexTitl...

NSString, problem to create

Hi, I have a problem with creation to NSString. The error is: "error: expected ']' before numeric constant". The code is below. Can you help me to find a solution for create these? NSString *titleXML = [NSString stringWithFormat:@"<?xml version="1.0" encoding="UTF-8"?>"]; ...

Objective-C subclass and base class casting

I'm going to create a base class that implements very similar functions for all of the subclasses. This was answered in a different question. But what I need to know now is if/how I can cast various functions (in the base class) to return the subclass object. This is both for a given function but also a function call in it. (I'm work...

Generate a random number within range?

Possible Duplicate: Generating Random Numbers in Objective-C How do I generate a random number which is within a range? ...

How to find out the format of a float?

I'm working with someone else's code, and there is a float with some unusual qualities. If I output the float using: NSLog(@"theFloat: %f", record.theFloat); I get: theFloat: 0.000000 However, if I use: NSLog(@"(int)theFloat = %i", (int) record.theFloat); I get: (int)theFloat: 71411232 How do I discover the real format and v...

UITableViewCell not appearing/reusing correctly from NIB

I have created a custom UITableViewCell from a NIB. Everything appears when the rowHeight is not set (albeit, everything is squished). I am not sure if I am reusing and creating the cells properly: // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath ...

How do I see if something is getting touched?

Is there some way in objective C to see if an instance is being touched such as: - (void)viewDidLoad { [super viewDidLoad]; if (recordButton.touched = YES) { NSLog (@"record button got touched"); } } Can't they just make these things easy? Could someone help? ...

Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell?

Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell? In my NIB I have already set the cell height. When I over-ride heightForRowAtIndexPath the contents of my cell don't appear, even though it is set to the height defined in the NIB. If I don't over-ride heightForRowAtIndexPath the contents of the cell appea...

Programatically created ViewController and awakeFromNiB?

I am creating a viewController programatically (hopefully the right way) My problem is that I previously created the controller in IB and have code I want to call in awakeFromNib. As I currently have things viewDidLoad works fine but awakeFromNib does not. Is there anyway to get awakeFromNib to call or an alternative method that I can us...

drawRect context Error

Hi, I heard that a lot of people get a context error by not using drawRect Now I have this: - (void)drawRect:(CGRect)rect { NSLog(@"drawRect: Starts"); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0); CGContextSetLineWidth(context, 3.0); CGContextMoveToPoint(co...

Uniform distance between points

Hello, How could I, having a path defined by several points that are not in a uniform distance from each other, redefine along the same path the same number of points but with a uniform distance. I'm trying to do this in Objective-C with NSArrays of CGPoints but so far I haven't had any luck with this. Thank you for any help. EDIT I wa...

Explanation of `self` usage during dealloc?

I'm trying to lock down my understanding of proper memory management within Objective-C. I've gotten into the habit of explicitly declaring self.myProperty rather than just myProperty because I was encountering occasional scenarios where a property would not be set to the reference that I intended. Now, I'm reading Apple documentation ...