AVAudioplayer is skipping -- sounds like a cd skipping

2009-07-13 Thread Miles
I'm using this basic code to play a sound and it frequently skips at the end, sounded like a cd skipping. I'm playing .caf files at 22500 Hz. Does anyone any experience with this? Thanks! int soundNum= arc4random() % [soundsArray count]; AVAudioPlayer *sound= [soundsArray objectAtI

Accessing variable set in 'Other C Flags'

2009-06-08 Thread Miles
I was reading on a couple blogs about setting 'Other C Flags' to -DTARGET_NAME=${TARGET_NAME} so that I can have multiple targets and differentiate between them in my code. But when I try to access it in my code it keeps treating the value of TARGET_NAME as a variable. In other words, if TARGET_NA

Re: How to animate an object in a circle, but preserve it's orientation

2009-06-05 Thread Miles
Awesome -- I'll give it a go. That makes total sense. Thanks so much! On Thu, Jun 4, 2009 at 9:04 PM, Graham Cox wrote: > > On 05/06/2009, at 1:48 PM, Miles wrote: > > Thanks for the quick response! >> >> I've mostly been reading trying to see what would wor

Re: How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Miles
in sync. Does that seem like the best and/or easiest approach? On Thu, Jun 4, 2009 at 8:40 PM, Graham Cox wrote: > > On 05/06/2009, at 1:34 PM, Miles wrote: > > I am trying to figure out the easiest way to make an object animate around >> a >> circle, but preserve it

How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Miles
I am trying to figure out the easiest way to make an object animate around a circle, but preserve it's orientation. Much in the way that a seat on a ferris wheel would look as it goes 'round. I assume there's a pretty simple solution, but I haven't thought of it yet. Thanks! ___

UIButton and UIView touch handling issues

2009-05-25 Thread Miles
I'm trying to create something similar to a piano where there are keys next to each other that should respond when a touch is dragged across them. I have it working with an outter controller that does a hittest on all it's children to find the key that is hit, but I'm trying to see if I can avoid

A couple NSRunLoop questions

2009-05-04 Thread Miles
1) I have a timer on a run loop. Every so often I invalidate the timer which as I understand it should remove the run loop as well. At a later time I start a new run loop (by calling the same method as before), then invalidate that timer after a while, and repeat. When I pause the debugger after t

Re: ObjectAlloc and objects that should have been released

2009-05-04 Thread Miles
n MainViewController -(void)loadView { } - (id)init { if (self = [super init]) {} return self; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc { NSLog(@"dealloc mvc"); [super dealloc]; } @end On Sun, Apr 26, 2009 at 12:55 PM, Miles wrote

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
Now I'm at a point where this is keeping the view around longer than I think it should: NSDictionary *rootDict= [[NSDictionary alloc] initWithContentsOfFile: filePath]; [rootDict release]; Could someone please explain what this is all about? Thanks! On Sun, Apr 26, 2009 at 12:16

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
s? I don't see any reason why this would still be hanging around. Ugh. On Fri, Apr 24, 2009 at 7:18 PM, Miles wrote: > Very interesting, I'll give all that a shot and report back. Thanks so > much! > > > > > On Apr 24, 2009, at 7:07 PM, Peter N Lewis wrote:

Re: ObjectAlloc and objects that should have been released

2009-04-24 Thread Miles
Very interesting, I'll give all that a shot and report back. Thanks so much! On Apr 24, 2009, at 7:07 PM, Peter N Lewis wrote: On 25/04/2009, at 8:28 , Miles wrote: I just mean that I'm adding some labels and images to the view. I have quadruple checked that they are

Re: ObjectAlloc and objects that should have been released

2009-04-24 Thread Miles
ohr wrote: > > Am 24.04.2009 um 01:27 schrieb Miles: > > But when I run this in ObjectAlloc, a bunch of parts of the view are still >> showing as 'created and still living'. It's very odd considering the >> deallocs are both called so nothing should be hangi

Re: ObjectAlloc and objects that should have been released

2009-04-23 Thread Miles
7;d use a NSAutoreleasePool in this case. Is this the same issue, or another one? Workarounds or fixes? Thanks On Wed, Apr 22, 2009 at 10:46 PM, Peter N Lewis wrote: > On 23/04/2009, at 10:19 , Miles wrote: > >> I have a timer that continues calling a method that for the

ObjectAlloc and objects that should have been released

2009-04-22 Thread Miles
I have a timer that continues calling a method that for the moment (testing purposes) only contains: NSArray *tmp = [NSArray arrayWithArray:animatingTilesArray]; The time is setup like this: animationTimer= [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(doAnimation:

How to show Navigation Controller flipped when device is upside-down

2009-04-21 Thread Miles
-- Is there a way to bring in a navigation controller view in flipped mode when the device is already flipped? shouldAutorotateToInterfaceOrientation works if the device is rotated after the navigation controller view has appeared, but if the device is already flipped w

Re: Reading in dictionary from txt file: options for speed

2009-04-20 Thread Miles
Exactly what I was thinking last night. I did this this morning -- split up the file into 26 files. Now everything is great. Thanks everyone! On Thu, Apr 16, 2009 at 11:16 PM, Greg Guerin wrote: > Miles wrote: > > I'm creating a game for where the dictionary file will neve

Re: Reading in dictionary from txt file: options for speed

2009-04-16 Thread Miles
t"]; stringFileContents = [[NSData alloc] initWithContentsOfMappedFile:filePath]; On Thu, Apr 16, 2009 at 5:55 PM, Greg Guerin wrote: > Miles wrote: > > const char *fileBytes = [stringFileContents bytes]; >>char *ptr= strstr(fi

Re: Reading in dictionary from txt file: options for speed

2009-04-16 Thread Miles
; char *ptr= strstr(fileBytes, cString); Thanks again On Thu, Apr 16, 2009 at 4:43 PM, Greg Guerin wrote: > Miles wrote: > > NSString *searchStr= @"\njoy\n"; >>NSData *strData= [searchStr >> dataUsingEn

Re: Reading in dictionary from txt file: options for speed

2009-04-16 Thread Miles
roject you sent, strBytes shows '\njoy\n' in the debugger (which is what I'd expect), but when i copy the exact code to a different project strBytes shows extra memory stuff after it, like '\njoy\n\x1b\x14\xc0' Seems very odd. On Thu, Apr 16, 2009 at 12:01 PM, Miles w

Re: Reading in dictionary from txt file: options for speed

2009-04-16 Thread Miles
Data bytes]; const char *fileBytes= [stringFileContents bytes]; char *ptr= strstr(fileBytes, strBytes); Is that what you were thinking? Thanks! On Thu, Apr 16, 2009 at 11:47 AM, WT wrote: > Marcel, > > since he'll be dealing with the string's raw bytes, won

Re: Reading in dictionary from txt file: options for speed

2009-04-16 Thread Miles
Marcel, NOW we're talking. This has really been such an eye-opening thread. Now it's googling time to try to figure out how to search for a string in there. Thanks! On Wed, Apr 15, 2009 at 7:01 PM, WT wrote: > Hi Marcel, > > that's quite impressive. On the simulator on my machine, it took

Re: Reading in dictionary from txt file: options for speed

2009-04-14 Thread Miles
Yep, I used your dictionaries, not mine. I'm on a core 2 2.8Ghz macbook pro. On Tue, Apr 14, 2009 at 6:15 PM, WT wrote: > On Apr 15, 2009, at 2:48 AM, Miles wrote: > > Sorry, Wagner, I'm a little spaced -- I didn't realize your test included >> getting the c

Re: Reading in dictionary from txt file: options for speed

2009-04-14 Thread Miles
goes with plist. On Tue, Apr 14, 2009 at 4:43 PM, Kyle Sluder wrote: > On Tue, Apr 14, 2009 at 7:23 PM, Miles wrote: > > *1) *I've been trying Kyle's suggestion for a few hours and I can't get > it > > working right. I broke it into this simple example, and it&#

Re: Reading in dictionary from txt file: options for speed

2009-04-14 Thread Miles
You guys are awesome! *1) *I've been trying Kyle's suggestion for a few hours and I can't get it working right. I broke it into this simple example, and it's not able to convert it to the 'word' struct. NSMutableData *data1; NSString *myString = @"\\x06hello\\x00"; const char *utfMyString = [mySt

Reading in dictionary from txt file: options for speed

2009-04-14 Thread Miles
[This is sort of in continuation of the thread "Build Settings for Release: App/Library is bloated", which gradually changed topics.] I'm trying to find the best way to load in a 2MB text file of dictionary words and be able to do quick searches. Simply loading the uncompressed txt file takes abou

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
Thanks Wagner. I'm actually just needing to verify if a word is in the dictionary, but maybe this is still a good choice? If I don't need to search for shared prefixes would I be better off using sqlite so i don't have to load it all into memory? On Sun, Apr 12, 2009 at 2:34 PM, WT wrote: > I

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
And BTW, my app is back down to 3.4MB after removing those classes and adding the dictionary in as a text file! That issue is now solved -- now I just need to figure out how to go about this approach :) awesome, thanks. On Sun, Apr 12, 2009 at 2:19 PM, Miles wrote: > > OK, it'

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
On Sun, Apr 12, 2009 at 1:30 PM, Kyle Sluder wrote: > On Sun, Apr 12, 2009 at 1:19 PM, Miles wrote: > > In the meantime if you have a good link handy about how to do this I > would > > appreciate it. > > If you put something in the Resources directory of the app bundle, you

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
2009 at 1:14 PM, Kyle Sluder wrote: > On Sun, Apr 12, 2009 at 12:11 PM, Miles wrote: > > I'm having similar issues in the application itself, but I'm currently > > working on the static library so those are the numbers I have handy. Does > > that add up? Is the

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
Thanks for the response. Under my release configuration where I'm currently building it just shows 'Standard (iPhone OS: armv6)' under 'Architectures', and 'Build Active Architecture Only' is checked. On Sun, Apr 12, 2009 at 1:08 PM, Dave Keck wrote: > You might be compiling for four archite

Re: Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
I. Savant wrote: > On Apr 12, 2009, at 3:11 PM, Miles wrote: > > My .app file and library file have both quickly grown to be 13MB in disk >> size and I'm having a hard time figuring out why. >> > > The .app bundle usually contains more than just your code. Have you >

Build Settings for Release: App/Library is bloated

2009-04-12 Thread Miles
My .app file and library file have both quickly grown to be 13MB in disk size and I'm having a hard time figuring out why. I've been reading about build settings and anything else I can get my hands on but I can't seem to make significant improvements. I don't know a ton about what happens in the c

static method to create CABasicAnimation: does this create a memory leak?

2009-04-09 Thread Miles
I have created a static method creating and returning an animation that I use in various places in my application. I think this may be causing a leak. If I autorelease theAnimation in the return statement I get a crash because I the animation must be being release before it's complete. Is this inde

Accessing other UI while keyboard is open

2009-03-08 Thread Miles
How do I still allow the UI to be accessed when the keyboard is open? I have a textfield and and switch and I want to be able to touch either of them while the keyboard is still open but it's currently being blocked. Thanks! ___ Cocoa-dev mailing list (

Re: Thread usage : Main thread interrupting secondary thread

2009-03-05 Thread Miles
Thanks for the response, Kyle- I'm trying to wrap my head around threading and this is my first experiment with it. I've been doing lots of reading on it but it'll take awhile to sink in. I'm trying to use threads because I sometimes animate lots of objects every 0.02 seconds and it bogs things d

Re: Thread usage : Main thread interrupting secondary thread

2009-03-05 Thread Miles
Sorry to bump this but it's driving me nuts. Even knowing if this sounds expected or unexpected would be really helpful at this point, so I can figure out where to go from here to solve this problem. Thanks again, in advance. On Thu, Mar 5, 2009 at 12:43 PM, Miles wrote: > > I

Thread usage : Main thread interrupting secondary thread

2009-03-05 Thread Miles
I'm new to using threads and hitting an unexpected issue. *There is an object moving across the screen on a separate thread started like this:* [NSThread detachNewThreadSelector:@selector( startObjectsAnimation: ) toTarget:animationHelper withObject:nil]; * Then in animationHelper:* NSAutorelea

Drawing on to a WebView

2008-12-02 Thread Miles Tinsley
has used MacRabbits CSSEdit app, the X-ray inspector mode does something similar, that I want to achieve. Many thanks Miles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list