I'm working on creating an NSDocument-based app with tabs for documents. I have found that it wasn't really designed for this. Apple designed the architechture to allow multiple windows for a single document but not the other way around. I have it basically working but I have started to run into weird issues. For example, when a window i...
I'm at the debugging/optimization phase with an iPhone app. I have one bottleneck left - the only place where the program has a noticeable lag, and it's in the following loop: (By the way, I've renamed the vars with letters and types. (The real names are much more human-readable in the actual app, but make little sense out of context, so...
How would I animate an NSView in from below. I know there are tutorials like Marcus Zarras which shows how to change from one view to another, but how would I animate in a view which isn't going to replace another view.
...
Hi, I've got a small problem. I've got an array and its size changes when passing to a c-function from an objective-c function.
void test(game_touch *tempTouches)
{
printf("sizeof(array): %d", sizeof(tempTouches) );
}
-(void)touchesEnded: (NSSet *)touches withEvent: (UIEvent *)event
{
game_touch tempTouches[ [touches count] ];
...
I'm mainly wondering about the affect that garbage collection would have on performance. Is the use of garbage collection frowned upon for release apps?
Another concern that I can think of is that using garbage collection could lead to sloppier programming.
Do you use garbage collection in your apps?
...
I've seen some apps that generate a warning when low memory is detected. I tried to do this in my app but ran into a problem. Using the simulator to simulate a memory warning, the alert generated pops up twice before I can hit "ok" and pops up 9 more times after that times before it finally goes away.
Is it a bad idea to generate an ...
For an iPhone application I need to request data from an online database. I choice to use for an restful web service. Main reason because it will connect to an JAVA server.
I did find a useful wrapper that helps me to get the data but now I need a good workaround to play with the data. The output is XML. If it is better to use JSON or s...
So im working on programming in objective c 2.0 book, and I'm working on a method to subtract 1 fraction object from another, I have the algorithm and everything set and it does work, but in going through the process (debugging) i found that even though i was copying the fractions into new instances so I wouldnt mess with the values in t...
Hello,
always when I try to generate a random number with Int = arc4random % MAXNUM the length of the number is as long as the MAXNUM number length -1.
So if I set arc4random % 1000000 the number is between 100000-999999. How can I get different numbers like 78, 476 or 4842?
Here a sample:
int number = arc4random() % 1000000;
outputLa...
I'd like to change the background image of a UITextField when it becomes the firstResponder to show the user that it has focus, similar to the :active or :focus pseudo-classes in CSS.
I'm guessing that I may need to do this programmatically; so any help is greatly appreciated.
-Giles
...
Hello,
I have an app with two views and ViewControllers. How can I let the user swip from one view to the next view like in the homescreen or the weatherapp.
I know that there is a page control in the Interface Builder, but it is just an Indicator on what page the user is.
Thanks and sorry for my bad english!
...
Hello,
sorry for my bad title (and noob question), but how can I add two numbers like 7 and 6 and the result should be 76. Is there a operation symbol in objective-c?
Thanks and sorry for my bad English.
...
I need to implement a native iPhone app to measure the velocity of the phone (basically a speedometer). I know that you can do so via the CoreLocation API fairly easily, but I am concerned about battery consumption since this is to be a real-time measurement that could be used for up to a couple of hours at a time. My understanding is ...
Hello,
my program generates random numbers with up to 6 digits with
int number = arc4random % 1000000;
I want that my program do something when a number like 66 or 4444 or 77777 appears (multidigit number with all digits identical). I could manual write:
switch (number) {
case 11: blabla...;
case 22: blabla...;
(...)...
Is there a way to monitor what view controller the navigation controller had before it pushed on the current view controller. also the opposite, what view controller it popped off the stack before getting to the current view controller?
Thank you in advance
...
Hi,
I am trying to use CloudMade's route-me service in my application. All I need from the service is driving distance between two locations, I don't want to display it in a map.
There doesn't seem to be any tutorial in CloudMade's website that handles this. I mailed to the support address they have provided. Nothing back from them so ...
Hello,
I want to use this code (from my last question (thanks Adam)),
bool AllDigitsIdentical(int number)
{
int lastDigit = number % 10;
number /= 10;
while(number > 0)
{
int digit = number % 10;
if(digit != lastDigit)
return false;
number /= 10;
}
return true;
}
but the c...
So I have an NSDictionary where the keys are years as NSString's and the value for each key is also an NSString which is sort of a description for the year. So for example, one key is "943 B.C.", another "1886". The problem I am encountering is that I want to sort them, naturally, in ascending order.
The thing is that the data source of...
Hello,
I want a blinking button. Actually my button look like this:
[redButton setImage:[UIImage imageNamed:@"Button1.png"] forState: UIControlStateNormal];
[redButton setImage:[UIImage imageNamed:@"ButtonPressed.png"] forState: UIControlStateHighlighted];
Now I want to change the Buttonpicture in the normal State every second from Bu...
I'm trying to re-write an application I have for Windows in Objective-C for my Mac, and I want to be able to do something like Mac's hot corners. If I move my mouse to the left side of the screen it will make a window visible, if I move it outside of the window location the window will hide again. (window would be pushed up to the left s...