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

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

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 graham@bigpond.com 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 work. I did mess

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!

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

2009-06-04 Thread Miles
that seem like the best and/or easiest approach? On Thu, Jun 4, 2009 at 8:40 PM, Graham Cox graham@bigpond.com 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's orientation. Much in the way

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

Re: ObjectAlloc and objects that should have been released

2009-05-04 Thread Miles
{ [super didReceiveMemoryWarning]; } - (void)dealloc { NSLog(@dealloc mvc); [super dealloc]; } @end On Sun, Apr 26, 2009 at 12:55 PM, Miles vardpeng...@gmail.com wrote: Wow. In that particular example it was '[UIScreen mainScreen] applicationFrame' that was causing the problem. When I

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

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
this would still be hanging around. Ugh. On Fri, Apr 24, 2009 at 7:18 PM, Miles vardpeng...@gmail.com 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 pe...@stairways.com.au wrote: On 25/04/2009, at 8:28

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
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 PM, Miles vardpeng

Re: ObjectAlloc and objects that should have been released

2009-04-24 Thread Miles
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 hanging around. What is „a bunch of parts of the view“ in your case

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 pe...@stairways.com.au 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

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

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

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 jrca...@gmail.com wrote: Hi Marcel, that's quite impressive. On the simulator on my

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

2009-04-16 Thread Miles
]; 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 jrca...@gmail.com wrote: Marcel, since he'll be dealing with the string's raw bytes, won't Miles have

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

2009-04-16 Thread Miles
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 vardpeng...@gmail.com wrote

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

2009-04-16 Thread Miles
= strstr(fileBytes, cString); Thanks again On Thu, Apr 16, 2009 at 4:43 PM, Greg Guerin glgue...@amug.org wrote: Miles wrote: NSString *searchStr= @\njoy\n; NSData *strData= [searchStr dataUsingEncoding:NSUTF8StringEncoding]; const char

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

2009-04-16 Thread Miles
] initWithContentsOfMappedFile:filePath]; On Thu, Apr 16, 2009 at 5:55 PM, Greg Guerin glgue...@amug.org wrote: Miles wrote: const char *fileBytes = [stringFileContents bytes]; char *ptr= strstr(fileBytes, cString); Are you certain the bytes returned

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 about

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 =

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

2009-04-14 Thread Miles
. On Tue, Apr 14, 2009 at 4:43 PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Tue, Apr 14, 2009 at 7:23 PM, Miles vardpeng...@gmail.com 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's not able

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 jrca...@gmail.com 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 contents into an array

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

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

2009-04-12 Thread Miles
idiotsavant2...@gmail.comwrote: 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 examined it to see where

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 davek...@gmail.com wrote: You might be

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

2009-04-12 Thread Miles
:14 PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Sun, Apr 12, 2009 at 12:11 PM, Miles vardpeng...@gmail.com 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

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

2009-04-12 Thread Miles
: On Sun, Apr 12, 2009 at 1:19 PM, Miles vardpeng...@gmail.com 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 can use NSBundle's -pathForResource:ofType: and related methods

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 vardpeng...@gmail.com wrote: OK

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

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

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

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:*

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 vardpeng...@gmail.com wrote

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

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