Search Results

Search found 1263 results on 51 pages for 'retain'.

Page 22/51 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • -[CCScene setOffsetx:]: unrecognized selector sent to instance

    - by Alexander Sharunov
    please help me, i'm very new in objective-c i've got 2 simplest classes (bellow first, second) i would like to set the offsetx properties of self.rolypoly object in second class like a self.rolypoly.offsetx=1 or run use [self.rolypoly setOffx]; to do somethings, but i always have the errors: trying [self.rolypoly setOffx]; in second class -[CCScene setOffx:]: unrecognized selector sent to instance 0x91d0b70' or trying self.rolypoly.offsetx=1; in second class -[CCScene setOffsetx:]: unrecognized selector sent to instance 0x808bfc0' first class //************************************************************ #import <Foundation/Foundation.h> #import "cocos2d.h" @interface RolyPoly : CCLayer { CCAction *_walkAction; CCSprite *_rolypoly; int offsetx; int offsety; } @property (nonatomic, retain) CCSprite *rolypoly; @property (nonatomic, retain) CCAction *walkAction; @property (nonatomic, assign) int offsetx; @property (nonatomic, assign) int offsety; +(id) scene; -(void) setOffx; @end //************************************************************ #import "GameLayer.h" #import "RolyPoly.h" @implementation RolyPoly @synthesize rolypoly = _rolypoly; @synthesize walkAction = _walkAction; @synthesize offsetx = _offsetx; @synthesize offsety = _offsety; +(id) scene { CCScene *scene = [CCScene node]; RolyPoly *layer = [RolyPoly node]; [scene addChild: layer]; return scene; } -(id) init { if ((self = [super init])) { [self scheduleUpdate]; } return self; } -(void) setOffx { NSLog(@"setOffx"); } -(void) update:(ccTime)delta { } - (void) dealloc { self.rolypoly = nil; self.walkAction = nil; [super dealloc]; } @end second class //************************************************************ #import <Foundation/Foundation.h> #import "cocos2d.h" #import "RolyPoly.h" @interface GameLayer : CCLayer { RolyPoly *_rolypoly; } // returns a CCScene that contains the HelloWorldLayer as the only child +(CCScene *) scene; @property (nonatomic, assign) RolyPoly * rolypoly; @end //************************************************************ #import "GameLayer.h" #import "RolyPoly.h" // HelloWorldLayer implementation @implementation GameLayer @synthesize rolypoly = _rolypoly; +(CCScene *) scene { CCScene *scene = [CCScene node]; GameLayer *layer = [GameLayer node]; [scene addChild: layer]; return scene; } -(id) init { if( (self=[super init])) { CGSize screenSize = [[CCDirector sharedDirector] winSize]; self.rolypoly = [RolyPoly scene]; [self addChild:self.rolypoly z:1]; [self.rolypoly setOffx]; [self scheduleUpdate]; } return self; } - (void)update:(ccTime)dt { } - (void) dealloc { [super dealloc]; } @end

    Read the article

  • Are there any tools to speed up Cocoa development?

    - by user262325
    I noticed that there is much repeated work to do when creating Cocoa source code. For example, if I set an instance for an object: NSMutableArray *infoArray; I need add code: @property (retain,nonatomic) NSMutableArray *infoArray; @synthesize infoArray; in - (void)dealloc { I also need add: [infoArray release]; Is there any tool that can automate this, perhaps by automatically paste or copy the source code and add the repeated code at right place?

    Read the article

  • How can I run an external program from C and parse its output?

    - by Josh Matthews
    I've got a utility that outputs a list of files required by a game. How can I run that utility within a C program and grab its output so I can act on it within the same program? UPDATE: Good call on the lack of information. The utility spits out a series of strings, and this is supposed to be complete portable across Mac/Windows/Linux. Please note, I'm looking for a programmatic way to execute the utility and retain its output (which goes to stdout).

    Read the article

  • SWF to FLV Quality

    - by Jay
    Hello, Any ideas on how to retain a good quality on converting SWF to FLV? I use the publish method in CS3, the quality of the movie goes terrible bad when converted to flv. Can anyone please suggest me some way out? Thank You

    Read the article

  • how reference copy is handled in Objective-C?

    - by Cathy
    Object graph [Instance A] tree / \ / \ / \ ↓ ↓ [Instance B] [Instance C] apple bug Question Instance A has to reference copies to Instance B and Instance C. If I retain or release Instance A, which has references to the other two instances, what happens to the various reference counts?

    Read the article

  • memory management objective c - returning objects from methods

    - by geeth
    Hi, Please clarify, how to deal with returned objects from methods? Below, I get employee details from GeEmployeetData function with autorelease, 1. Do I have to retain the returned object in Process method? 2. Can I release *emp in Process fucntion? -(void) Process { Employee *emp = [self GeEmployeetData] } +(Employee*) GeEmployeetData{ Employee *emp = [[Employee alloc]init]; //fill entity return [emp autorelease]; }

    Read the article

  • expecte ')' before className

    - by Akbarbuneri
    Hi I have a class DataObject as Header ::: #import <Foundation/Foundation.h> @interface DataObject : NSObject { NSString *erorrMessage; BOOL hasError; NSDictionary *dataValues; } @property(nonatomic, retain)NSString *erorrMessage; @property(nonatomic)BOOL hasError; @property(nonatomic, retain)NSDictionary *dataValues; @end Class Implementation:::: #import "DataObject.h" @implementation DataObject @synthesize erorrMessage; @synthesize hasError; @synthesize dataValues; @end And I have another class as DataManager Header as :::: #import <Foundation/Foundation.h> @interface DataManager : NSObject - (DataObject *)getData :(NSString*)url; @end Implementation :::: #import "DataManager.h" #import "DataObject.h" #import "JSON.h" @implementation DataManager - (DataObject *)getData :(NSString*)url{ DataObject* dataObject = [[DataObject alloc]init]; NSString *urlString = [NSString stringWithFormat:url]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; //TODO: Here we have to check the internet connection before requesting. NSError * erorrOnRequesting; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&erorrOnRequesting]; NSString* responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if( erorrOnRequesting != nil) { dataObject.hasError = YES; dataObject.erorrMessage = @"Error on requsting to the web server"; return dataObject; } NSError *errorOnParsing; SBJSON *json = [[SBJSON new] autorelease]; NSDictionary *dataValues = [json objectWithString:responseString error:&errorOnParsing]; [responseString release]; if(errorOnParsing != nil) { //TODO: We have to send the website a feedback that there is some problem on the server end. dataObject.hasError = YES; dataObject.erorrMessage = @"Error on parsing, the server returned invalid data."; return dataObject; } dataObject.hasError = NO; dataObject.dataValues = dataValues; return dataObject; } @end Now when I build I got an error in the DataManager header where I #import Dataobject header, it says "error: expected')' before DataObject" I don;t understand what I miss. Thanks for the help..

    Read the article

  • Redirect to current view on error in asp.net mvc?

    - by Pandiya Chendur
    I use TempData["message"] which internally uses session.... It works for me but when i do a return RedirectToAction("Create"); my other values are not restored because i am redirecting to Create view... Any suggestion how to retain the values of textboxes in the view..... if (!regrep.registerUser(reg)) { TempData["message"] = string.Format("{0} already exists", reg.EmailId); return RedirectToAction("Create"); } else { return RedirectToAction("Index"); }

    Read the article

  • NSString cannot be released

    - by Stanley
    Consider the following method and the caller code block. The method analyses a NSString and extracts a "http://" string which it passes out by reference as an auto release object. Without releasing g_scan_result, the program works as expected. But according to non-arc rules, g_scan_result should be released since a retain has been called against it. My question are : Why g_scan_result cannot be released ? Is there anything wrong the way g_scan_result is handled in the posted coding below ? Is it safe not to release g_scan_result as long as the program runs correctly and the XCode Memory Leak tool does not show leakage ? Which XCode profile tools should I look into to check and under which subtitle ? Hope somebody knowledgeable could help. - (long) analyse_scan_result :(NSString *)scan_result target_url :(NSString **)targ_url { NSLog (@" RES analyse string : %@", scan_result); NSRange range = [scan_result rangeOfString:@"http://" options:NSCaseInsensitiveSearch]; if (range.location == NSNotFound) { *targ_url = @""; NSLog(@"fnd string not found"); return 0; } NSString *sub_string = [scan_result substringFromIndex : range.location]; range = [sub_string rangeOfString : @" "]; if (range.location != NSNotFound) { sub_string = [sub_string substringToIndex : range.location]; } NSLog(@" FND sub_string = %@", sub_string); *targ_url = sub_string; return [*targ_url length]; } The following is the caller code block, also note that g_scan_result has been declared and initialized (on another source file) as : NSString *g_scan_result = nil; Please do send a comment or answer if you have suggestions or find possible errors in code posted here (or above). Xcode memory tools does not seem to show any memory leak. But it may be because I do not know where to look as am new to the memory tools. { long url_leng = [self analyse_scan_result:result target_url:&targ_url]; NSLog(@" TAR target_url = %@", targ_url); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Scanned Result" message:result delegate:g_alert_view_delegate cancelButtonTitle:@"OK" otherButtonTitles:nil]; if (url_leng) { // ****** The 3 commented off statements // ****** cannot be added without causing // ****** a crash after a few scan result // ****** cycles. // ****** NSString *t_url; if (g_system_status.language_code == 0) [alert addButtonWithTitle : @"Open"]; else if (g_system_status.language_code == 1) [alert addButtonWithTitle : @"Abrir"]; else [alert addButtonWithTitle : @"Open"]; // ****** t_url = g_scan_result; g_scan_result = [targ_url retain]; // ****** [t_url release]; } targ_url = nil; [alert show]; [alert release]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(activate_qr_scanner:) userInfo:nil repeats:NO ]; return; }

    Read the article

  • string or nsstring with string

    - by joels
    Lets assume myProp is @property (retain) NSString * myProp and synthesized for us.... self.myProp = @"some value";//string literal? self.myProp = [NSString stringWithString:@"some value"]; Is there a difference here? Is the first one a string literal that doesnt get autoreleased or is it just in memory for it's current scope and I dont have to worry about it?

    Read the article

  • asp.net mvc Upload File ajax

    - by Bill White
    Hi ive got an mvc form with a fileupload functionality. Ive got an action that accepts an file and extracts thumbnails from it, after which the user can select the images and then proceed to submit the form. How can post the initial file via ajax, bearing in mind, this is not the final submission on the form and I want to retain user input. ie no postback Thanks

    Read the article

  • UIImage Fade in after load on my UITable

    - by Cy
    I have an UIImage that loads from the web, and I'd like it to fade in when it displays in my UITableCell. if([thumb image]) { UIImage *imagen = [thumb.image retain]; [imagen drawInRect:CGRectMake(15, 4, 44, 44)]; [imagen release]; } How could I achieve it?

    Read the article

  • unchecked the store only latest version in VSS for a project?

    - by SCM
    Hi I have an issue in VSS 2005, there is a project in VSS, having multiple folders files in it, and most of the files around 2000 having their property "Store only latest version" is checked. I don't know how it is set. I want to change those around 2000 files property "Store only latest version" to unchecked, so that VSS retain all those files previous version. can it be done through a single command to unchecked this option for all those files in project recursively? Thanks

    Read the article

  • How to make an private property?

    - by mystify
    I tried to make a private property in my *.m file: @interface MyClass (Private) @property (nonatomic, retain) NSMutableArray *stuff; @end @implementation MyClass @synthesize stuff; // not ok Compiler claims that there's no stuff property declared. But there's a stuff. Just in an anonymous category. Let me guess: Impossible. Other solutions?

    Read the article

  • SVN Export while retaining permissions

    - by Jonathan
    Hey all- I have some files in my SVN repository that I would like to have execute permissions. When I check them into the repository with 755 permissions and run an svn export, the resulting files have 644 permissions. There doesn't appear to be an option in "svn export" to retain the permissions. Am I missing something? Thanks- Jonathan

    Read the article

  • obj-c, how do I create a property and synthesize an NSUInteger ?

    - by Jules
    I'm having some trouble using an NSUInteger, I've tried various things and googled, but not found the answer ? I have... I also tried ... nonatomic, retain @property (readwrite, assign) NSUInteger *anAmount; @synthesize anAmount; error: type of property 'anAmount' does not match type of ivar 'anAmount' Also when I release it in dealloc I get a warning.. warning: invalid receiver type 'NSUInteger'

    Read the article

  • Static variables within functions in C++ - allocated even if function doesn't run?

    - by John C
    I've been reading up on C++ on the Internet, and here's one thing that I haven't been quite able to find an answer to. I know that static variables used within functions are akin to globals, and that subsequent invocations of that function will have the static variable retain its value between calls. However, if the function is never claled, does the static variable get allocated? Thanks

    Read the article

  • Separating a group of functions into an includable file in C?

    - by zebra
    I know this is common in most languages, and maybe in C, as well. Can C handle separating several functions out to a separate file and having them be included? The functions will rely on other include files, as well. I want the code to retain all functionality, but the code will be reused in several C scripts, and if I change it once I do not wish to have to go through every script and change it there, too.

    Read the article

  • Haskell mutability in compiled state?

    - by pile of junk
    I do not know much about Haskell, but from what I have read about the mutability of computations (e.g: functions returning functions, complex monads and functions, etc.) it seems like you can do a lot of meta-programming, even at runtime. How can Haskell, if everything like functions and monads are so complex, compile to machine code and retain all this?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >