Search Results

Search found 169 results on 7 pages for 'harel moshe'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • What's a good way to remove all of the subviews of a UIScrollView?

    - by Moshe
    I have a scroll view and I need to reload the contents often while my app is running. Right now, I'm using the following line of code to remove the subviews before adding them back again: [scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; Should I be using the following instead? scrollView.subviews = nil; For some reason, the (first) above line of code seems to crash the app every 16 times it is run. Am I leaking memory somewhere? The following method takes an array of views, the scroller (which is a constant) and the direction. Edit: - (void)loadViews:(NSArray *)views IntoScroller:(UIScrollView *)scroller withDirection:(NSString *)direction{ //Set up the scrollView [scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; if([direction isEqualToString:@"horizontal"]){ scrollView.frame = CGRectMake(0, 0, 1024, 768); scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * [[NSNumber numberWithUnsignedInt:[views count]] floatValue], scrollView.frame.size.height); }else if([direction isEqualToString:@"vertical"]){ scrollView.frame = CGRectMake(0, 0, 1024, 768); scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, scrollView.frame.size.height * [[NSNumber numberWithUnsignedInt:[views count]] floatValue]); } for (int i=0; i<[[NSNumber numberWithUnsignedInt:[views count]] intValue]; i++) { [[[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view] setFrame:scrollView.frame]; if([direction isEqualToString:@"horizontal"]){ [[[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view] setFrame:CGRectMake(i * [[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view].frame.size.width, 0, scrollView.frame.size.width, scrollView.frame.size.height)];//CGRectMake(i * announcementView.view.frame.size.width, -scrollView.frame.origin.x, scrollView.frame.size.width, scrollView.frame.size.height)]; }else if([direction isEqualToString:@"vertical"]){ [[[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view] setFrame:CGRectMake(0, i * [[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view].frame.size.height, scrollView.frame.size.width, scrollView.frame.size.height)]; } [scrollView addSubview:[[views objectAtIndex:[[NSNumber numberWithInt:i] unsignedIntValue]] view]]; } }

    Read the article

  • Getting info from NSData object

    - by Moshe
    How would I get returningResponse (into say, a NSString) from the following code: NSURLResponse* response; NSError* error; NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; I think I can get the info that I need into a string but I can't call anything on response because it's null. Therefore, I assume that I need to call something on result. The problem is, I don't know what to call. (The URL request has been coded prior to the code sample. I know that that works.) I want to be able to detect if the request as successful.

    Read the article

  • iPhone modal View with alpha transparency?

    - by Moshe
    I am adding a modal view using the following code: [self presentModalViewController:phrasesEditor animated:YES]; How can I make the modal view semi-transparent so that the superview "shines" through? My complete method/function looks like this: -(IBAction)showEditPhrases:(id)sender{ PhrasesViewController *phrasesEditor = [[PhrasesViewController alloc] initWithNibName:@"PhrasesViewController" bundle:nil]; phrasesEditor.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [phrasesEditor.view setAlpha: 0.5]; [phrasesEditor.view setBackgroundColor: [UIColor clearColor]]; [self presentModalViewController:phrasesEditor animated:YES]; [phrasesEditor release]; }

    Read the article

  • Checking the time in Objective-c?

    - by Moshe
    how can I get the current time in hh:mm format? I need to be able to tell between AM and PM and compare between the current time and a second time as well. I'm sure it's a silly function but i can't seem to figure it out.

    Read the article

  • Key logging in .NET

    - by Moshe
    Is it possible to write a key logger in Visual Basic.NET? Is this the right language to be using? So far, I've gotten a console app to read input and append to a file. 1)How can I make a .NET program "catch" all keyboard input? 2)How do I make a process not show up in Task Manager? This is not for a virus, but rather a parental control program for a specific clientele. No malicious intent here.

    Read the article

  • iPhone modal View with parent view semi-visible?

    - by Moshe
    I am adding a modal view using the following code: [self presentModalViewController:phrasesEditor animated:YES]; How can I make the modal view semi-transparent so that the superview "shines" through? My complete method/function looks like this: -(IBAction)showEditPhrases:(id)sender{ PhrasesViewController *phrasesEditor = [[PhrasesViewController alloc] initWithNibName:@"PhrasesViewController" bundle:nil]; phrasesEditor.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [phrasesEditor.view setAlpha: 0.5]; [phrasesEditor.view setBackgroundColor: [UIColor clearColor]]; [self presentModalViewController:phrasesEditor animated:YES]; [phrasesEditor release]; }

    Read the article

  • Line breaks in "NSString"s returned from PList don't work.

    - by Moshe
    I've seen this post: http://stackoverflow.com/questions/2035567/nsstring-newline-escape-in-plist but I'd like to know if there's a way to pragmatically render \n line breaks. I'm currently using: decisionText.text = [NSString stringWithFormat: (@"%@", [replies objectAtIndex:(arc4random() % [replies count])])]; Which randomly grabs a String from the replies array. The array was loaded from a plist like so: replies = [[NSMutableArray alloc] initWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"AdviceList" ofType:@"plist"]]; What am I missing? The answer can't be to manually enter line breaks. That's not programming! (Sounds like word processing to me.)

    Read the article

  • Release objects before returning a value based on those object?

    - by Moshe
    Consider the following method, where I build a string and return it. I would like to release the building blocks of the sting, but then the string is based on values that no longer exists. Now what? Am I leaking memory and if so, how can I correct it? - (NSString) getMiddahInEnglish:(int)day{ NSArray *middah = [[NSArray alloc] initWithObjects:@"Chesed", @"Gevurah", @"Tiferes", @"Netzach", @"Hod", @"Yesod", @"Malchus"]; NSString *firstPartOfMiddah = [NSString stringWithFormat: @"%@", [middah objectAtIndex: ((int)day% 7)-1]]; NSString *secondPartOfMiddah = [NSString stringWithFormat: @"%@", [middah objectAtIndex: ((int)day / 7)]]; NSString *middahStr = [NSString string@"%@ She'bi@%", firstPartOfMiddah, secondPartOfMiddah]; [middah release]; [firstPartOfMiddah release]; [secondPartOfMiddah release]; return middahStr; }

    Read the article

  • What challenges are there in making an iPhone IDE for Windows/Linux?

    - by Moshe
    First of all, is this possible? If so: What challenges would I encounter in making an XCode imitation for iPhone/iPod development for Windows or Linux? I was thinking about using gcc as the actual compiler for the objecitve-c. Will that work? It doesn't need to compile to iPhone OS until it is to be tested on the device or submitted to the app store. Perhaps it will be easier to compile to the local OS format (Windows or Linux) until "prime-time".

    Read the article

  • Basic syntax for an animation loop?

    - by Moshe
    I know that jQuery, for example, can do animation of sorts. I also know that at the very core of the animation, there must me some sort of loop doing the animation. What is an example of such a loop? A complete answer should ideally answer the following questions: What is a basic syntax for an effective animation recursion that can animate a single property of a particular object at a time? The function should be able to vary its target object and property of the object. What arguments/parameters should it take? What is a good range of reiterating the loop? In milliseconds? (Should this be a parameter/argument to the function?) REMEMBER: The answer is NOT necessarily language specific, but if you are writing in a specific language, please specify which one. Error handling is a plus. {Nothing is more irritating (for our purposes) than an animation that does something strange, like stopping halfway through.} Thanks!

    Read the article

  • int vs NSNumber vs NSInteger

    - by Moshe
    I have a line of code that will work differently depending on the datatypes "day" and "1". I believe it is the following although I will check my source code later. day = day + 1; Does this make sense? What would the differences be?

    Read the article

  • Dottrace Dead vs. Garbage

    - by Moshe
    After reading the dottrace documentation I realized that: Dead objects are objects deleted before the end point of the snapshot. Garbage objects are objects allocated after the starting point and deleted before the end point - in other words, "Garbage objects" is a subset of "Dead objects". But after doing some profiling sessions, I could see that sometimes the number of "Garbage objects" is by far greater than the number of "Dead objects" of the same class (for example System.String). How should I interpret this phenomenon?

    Read the article

  • Is it possible to call a JavaScript function using an array of values as arguments ?

    - by Moshe Levine
    I'm looking for another way of doing the following: function call_any_function(func, parameters){ // func => any given function if(parameters.length==0){ func(); } if(parameters.length==1){ func(parameters[0]); } if(parameters.length==2){ func(parameters[0], parameters[1]); } if(parameters.length==3){ func(parameters[0], parameters[1], parameters[2]); } if(parameters.length==4){ func(parameters[0], parameters[1], parameters[2], parameters[3]); } // ... and so on }; It seems basic but I couldn't find an answer. Any ideas?

    Read the article

  • Why does addSubview load the view asynchronously

    - by moshe
    I have a UIView that I want to load when the user clicks a button. There happens to be some data processing that happens as well after I call addSubview that involves parsing an XML file retrieved from the web. The problem is the view doesn't show up until after the data processing even if addSuview is called first. I think I'm missing something here, can anyone help? Code: I have a "Loading..." view I'm adding as a custom modal (meaning I'm not using the modalViewController). This action is linked to a button in the navigationController. - (IBAction)parseXml:(id)sender { LoadingModalViewController *loadingModal = [[LoadingModalViewController alloc] initWithNibName:@"LoadingModalViewController" bundle:nil]; [navigationController.view addSubview:loadingModal.view]; [xmlParser parse]; }

    Read the article

  • Restoring older firmware through XCode?

    - by Moshe
    I'm trying to restore iPhone OS 3.1.3 to a 3GS that has been upgraded to iOS 4. iTunes refuses to complete the install. What needs to be done? I am currently using the GM XCode. Should I be using the latest public stable version instead? Update: XCode reports that "The baseband cannot be rolled back".

    Read the article

  • Simpler reachability ApI?

    - by Moshe
    I've downloaded the Reachability API and I'd like to know if there is a simpler version anywhere, or if someone can point out the bare-bones essential part of it, so that I don't need to add tons of files to my project. I don't need the whole API, I just need to check for any sort of connectivity, a particular host will be assumed available after that.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >