Hey guys!
Now I have one trouble for develope one iPhone app.
I need to compute 150 parts and draw it on canvas.
I have code like this:
for (int i=x1; i<=x2; i++) {
for (int j=y1; j<=y2; j++) {
x=[NSNumber numberWithInt:i];
y=[NSNumber numberWithInt:j];
BoxCach...
Hi I am making a program that gets input from the keyboard and I was wondering if there was any way to get input from the keyboard and store it in an NSString object.
...
the purpose of this question is to make it easier for developers trying to migrate between the two. If you want to learn one technology, you'll want to know how its different from those that you know.
What should someone know when switching between the Cocoa and .NET frameworks?
Related:
.Net guy needs some info on Cocoa
...
Here's a simplified version of my code:
- (IBAction)convert:(id)sender
{
/* these two lines are ignored */
[textbox setStringValue:@"converting"];
[convertButton setEnabled:NO];
pid_t pid;
if((pid=fork())==-1)
{
[log setStringValue:@"couldn't fork a new process."];
converting = 0;
[convertBut...
Is there a way to detect whether a Unicode character is present in a font on the iPhone, i.e., to detect whether the character will map to a printable glyph or instead to the square "missing character" symbol?
For example, if I want to generate a random Wingding character with this snippet:
NSString *s = [NSString stringWithFormat:@"%C...
I've been using the following code to issue clicks programmatically on a Mac
void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint point)
{
CGEventRef theEvent = CGEventCreateMouseEvent(NULL, type, point, button);
CGEventSetType(theEvent, type);
CGEventPost(kCGHIDEventTap, theEvent);
CFRelease(theEve...
I have (at least) two views which have the same table view but other stuff around, depending on how the user navigated in the app. Ideally, I would like to have a generic table view and controller which other views and controllers
could, for lack of a better term, "include". This would then allow me to encapsulate all the table view and ...
I have an app with a button 'convert'. When I click this button, the app starts a new process using NSTask and then greys out the button until the process finishes.
My problem is, the app saves any clicks made by the user while it is waiting for the process to finish. So even though the button is grayed out, the user can click it and th...
I haven't used NSDate that much, so I'd like some help with a calculation I am doing.
I have an integer that has my store's closing hour in minutes since midnight. Basically, my store closes at 5.00PM, which gives me the integer 1020.
So right now it's 10.45PM or 22.45. Integer since 00:00 is 1365, and from this I can say
if (storeHou...
when i'm calling the below function in a time interval of 1 second, it would cause Not Responding in Activity Monitor, anyone can tell me why and suggest a solution?
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];
NSDictionary* currentAppInfo = [workspace activeApplication];
//get the PSN of the current app
UInt32 lowLon...
Hi there
I am developing a game using Cocos2D. I got some error out of sudden after few time successfully played the game. And When i debugged it gives the error called EXC_BAD_ACCESS.
here is the code.
-(void) winGame
{
//the debug stopped here...
WinningScene *winner = [WinningScene node];
[[Dire...
I am trying to create a simple integer variable and can't get it to accept a value.
Why does the NSLog print out i=(null)?
int i;
i = 0;
NSLog(@"i=%@", i);
How do I create a simple index for an array?....
Thank you...
...
I want to use push notification in my app.I have created an unique app id and created push development certificate.also created provisioning profile using that unique app id.I put the code for registering the device in application terminate method so that when my app closed it's enabled push notification and when it launches it disables ...
My code looks like down this:
-(void)touchBegan:(HWPoint *)point {
switch (self.states) {
case HWDrawState:
HWShape *shape = [[HWShapeManager sharedInstance] addShapeWithType:_shapeClass];
break;
case HWSelectState:
break;
case HWDeleteState:
break;
default:
brea...
I have an instance variable *TangramLevel(:UIView) currentLevel; in my viewController class, and I have an instance allocated at start (it's retainCount 1). I attached it to the view [self.view addSubview:currentLevel]; (retainCount 2).
When the level finishes, it notifies the controller, so controller removes it from the view [currentL...
Hello!
I have a problem with classes. This is my code:
self.shapeClass = [HWRectangle class];
if ([_shapeClass isKindOfClass:[HWRectangle class]]) {
NSLog(@"Class created as: %s", [_shapeClass description]);
}
I thought that the program will do the logging in this case, but it doesn't. Do you have any idea why not?
...
Trying to integrate plain C/C++ code into iPhone project as an external static library. So far so good, but now I'm stuck at a point, where I need to register library callbacks. The library should notify my iPhone application, when something happens. Seems like a good place to define a Delegate.
...but the library is expecting C functio...
I'm trying to create a text file with the contents of a string to my desktop. I'm not sure if I'm doing it right, I don't get errors but it doesn't work either...
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES);
NSString *desktopDirectory=[paths objectAtIndex:0];
NSString *filename = [desk...
I am pretty sure I am doing this right, but just wanted to check. I have two instance variables that have accessors created via @property. In my dealloc (for the same object) I am releasing these objects.
@property(copy) NSString *firName;
@property(copy) NSString *surName;
-(void)dealloc {
NSLog(@"_deal: %@", self);
[firName r...
Just wondering if there are methods already implemented for handling linear interpolation between two numbers in foundation/something else that comes with Xcode? It's hardly an advanced thing to implement yourself, but I usually find myself reimplementing things that have already been implemented, and it's nice to use functionality that ...