This seems like a basic question.. but my array size is 64 and I am replacing an object at index 63. Like this:
[myMutableArray replaceObjectAtIndex:myIndex withObject:myObj];
So I have no idea why gdb is telling me this:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index...
I'm trying to plot some data by timestamp in a NSOpenGLView. I also want to overlay some non-openGL Cocoa elements above the data, such as highlighting boxes. My difficulty is in getting the coordinate systems to line up.
My data's timestamps are in seconds since the epoch. The values run from -2 to 2. I can plot the raw data without to...
I have some calculation that involves negative values:
row = (stagePosition - col) / PHNumRow;
Say stagePosition is -7 and col is 1. They are both NSInteger, including row.
PHNumRow is 8.
If PHNumRow is NSInteger, I get the result I expect: -1.
But if PHNumRow is NSUInteger, the result is garbage.
Why should it matter if the divisor...
I'm beginning to think that my Cocoa application is not really done according to the principles of MVC. My problem is the following:
I have some classes in my project, one of called Copier.h and another called DropReciever.h. Copier is sort of my main view controller, as it has all the bindings and main methods. DropReciever is a custom...
I'm using an NSArrayController, NSMutableArray and NSTableView to show a list of my own custom objects (although this question probably applies if you're just showing a list of vanilla NSString objects too).
At various points in time, I need to clear out my array and refresh the data from my data source. However, just calling removeAll...
I have a date string (well, NSData, but that's easy to convert to a string) that's in what I believe is the format the HTTP standard uses:
Mon Apr 17 19:34:46 UTC 2006
Is there any better (i.e. less error-prone) way to parse that than specifying the format string by hand in an NSDateFormatter?
(My application is an iPhone app, but I ...
In regards to iPhone development, how do you now when your using a Cocoa vs pure Objective-C objects. For example, the following are Objective-C:
NSTimer
NSString
int, float
NSMutableArray
But these are Cocoa:
UILabel
UIColor(?)
UIView
And to be clear, does
Cocoa Touch == iPhone development
Cocoa == Mac OS X development
...
I'm not sure if I'm doing something wrong here:
I'm registering for Workspace notifications using this snippet in awakeFromNib
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver:self
selector:@selector(noteReceived:)
name:nil
object:nil];
the selector noteReceived: takes a single NSNoti...
I have a document-based application and I have sub-classed NSDocument and provided the required methods, but my document needs some extensive clean-up (needs to run external tasks etc). Where is the best place to put this? I have tried a few different methods such as:
close
close:
canCloseDocumentWithDelegate:shouldCloseSelector:contex...
I have an NSTableView and an NSOutlineView, both with their content provided by bindings, that I'd like to have some drag-and-drop functionality:
Drag rows from Table A onto a row of Outline B, where they will be copied into a data structure which the row in Outline B represents.
Drag a row from Outline B onto another row in Outline B,...
Using OpenGL ES on the iPhone, is it possible to do bump mapping (using normal perturbation maps)?
From my google searching, it seems the OpenGL ES extension that supports it doesn't allow bump mapping.
According to this guy that writes gaming middleware for the iphone, one can see the potential of the hardware by watching demos on th ...
Hi,
im trying to cut a image and mask it....that im able to do successfully..but the program exits after few minutes with 101 status
- (void) maskImage {
if(scopeOn==1){
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
cachedImage=[UIImage imageNamed:@"loop.png"];
c...
Hi all,
I'm curious what strategy most of you are employing in order to build solid RESTful iPhone clients in respect to model hierarchies. What I mean by model hierarchies is that I have a REST server in which several resources have a correlation to each other. For instance, let's say for hypothetical purposes I have a REST server whic...
I'm looking to do something simple such as drilling down on a particular UITableViewCell, which brings up a detail view controller. Within there, the user has the capability to change the attribute for the model underneath the cell. For instance, If I'm displaying a list of quotes, and a user clicks on a quote and favorites it in the chi...
I am new to Cocoa and I am working my way through the examples in Hillegass's book 'Cocoa programming for Mac OS-X'. There have been a couple of occasions when a sample application I have been working through starts up and I get a message such as :
2009-03-11 00:39:19.167 CarLot[7517:10b] Cannot create NSData from object <_NSController...
I need to hash a string using the MD5 technique in cocoa. Any frameworks that are used must be able to be accessed on the iphone. please provide code if possible.
...
I have a C function with the following method signature.
NSString* md5( NSString *str )
How do I call this function, pass in a string, and save the returned string?
I tried the following, but it did not work:
NSString *temp= [[NSString alloc]initWithString:md5(password)];
thanks for your help
...
I have created a while-loop in which temporary strings are created (string is updated everytime that loop performs). How can I create an array out of these temporary strings?
...
I have got two timevalues in the format: %H%M%S (E.G.161500)
These values are text-based integers.
Is there a simple function in Cocoa that calculates the difference between these two integers using a 60 seconds and minutes scale?
So if
time 1 = 161500
time 2 = 171500
timedifference = 003000
...
I found out how to create a window in Cocoa programmatically but can't figure out how to react to events. The window is not reacting to a Quit request or button click.
I tried adding the following controller and used setDelegate/setTarget without luck:
@interface AppController : NSObject {
}
- (IBAction)doSomething:(id)send...