See the documentation for - (NSDictionary *)attributesOfItemAtPath:(NSString
*)path error:(NSError **)error in NSFileManager.
The returned dictionary has a convenience method -fileSize.
Best,
Hank
On Aug 31, 2011, at 3:51 PM, Jon Sigman wrote:
How does one determine the size of a file on
On Jul 15, 2011, at 3:38 PM, Kevin Muldoon wrote:
Hey guys,
I know of at least one way to fix this memory leak but I'm hoping to find a
few more ways.
I'm chewing through a text file of 205,960 lines in a C while loop. All is
good until MyObject returns a value. Of course the return
Two ways that I've used:
1. Keep a boolean isInCurrentConditions that you set when you start the
current_conditions element and reset when you end that element. Then every time
you enter a condition element you check the boolean to see if you are where you
need to be in the hierarchy. This
On Jun 2, 2011, at 1:44 PM, Jim Adams wrote:
True. But the situation we were running into was that a server might not be
up and I could tell faster with ping than a timer.
The point (that others have already made) is not that ping is fast, but that
(a) a successful ping doesn't tell you if
On May 18, 2011, at 1:55 PM, Bing Li wrote:
Dear all,
I am creating an XML chars to transmit over TCP. When an XML is created, I
attempt to release some resources. However, I got some weird results.
The XML is simple as follows.
?xml version=1.0 encoding=UTF-8?
MessageRoot
Try #ifdef instead of #if.
On May 18, 2011, at 4:09 PM, Development wrote:
I have a version of an application that I want to contain different code
based on the builded target.
for instance I have a lite version. After defining the ISFREE value in the
preprocessor macros... I tried using:
On May 10, 2011, at 6:34 AM, Brian Bruinewoud wrote:
Hi All,
Just curious, why does this work (compiles and runs):
displayLink = [NSClassFromString(@CADisplayLink) displayLinkWithTarget:
tapped selector:@selector(respond:)];
But this doesn't link because the CADisplayLink class is
Have you looked at this?
http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html
Hank
On Apr 29, 2011, at 2:16 PM, Abhinav K Tyagi wrote:
Hi Laurent,
I too agree with you on this. The circular shape i just mention as a case.
It can be any shape.
Its just an idea.. good
You're thinking of kAudioUnitProperty_MaximumFramesPerSlice
(http://developer.apple.com/library/ios/#qa/qa1606/_index.html). You have to
set that to 4096 frames per slice for every audio unit that's not the remoteIO
unit.
Hank
On Apr 26, 2011, at 11:05 AM, Gregory Wieber wrote:
In the iOS
On Apr 19, 2011, at 1:51 PM, Frederick C. Lee wrote:
Greetings:
Simple scenario: background thread is computing data to be displayed in real
time within the main thread.
Data: dynamic/variable data that is converted into a NSString type within a
background thread, displayed within a
Typing customize uiswitch into Google returned this as the second hit:
http://osiris.laya.com/projects/rcswitch/
Might be worth looking at.
Hank
On Apr 4, 2011, at 10:22 PM, Philip Ershler wrote:
The first thing I tried to do was to subclass the UISwitch. But when one
looks at the docs for
On Apr 1, 2011, at 9:29 AM, Carlos Eduardo Mello wrote:
Hi people,
I just realized I may be doing something dangerous with an NSMutableArray. I
searched Guides and References on this but couldn't find an explicit answer:
- Does an NSMutableArray guarantee to retain an object on
On Apr 1, 2011, at 9:49 AM, Carlos Eduardo Mello wrote:
The objects in this array are the main thing in my app. Various parts of the
UI direct actions to each one of them, when they are selected (only one at a
time). The objects contain a path which is drawn and used for hit detection
and
On Mar 30, 2011, at 11:14 PM, Sasikumar JP wrote:
I am new to iOS Audio Technology.
I am developing an application which will play streaming audio(mp3), planning
to add some effects like iPod Equalizer,Pan Control.
I have tried to use Matt Gallagher's AudioStreamer API
On Mar 24, 2011, at 12:06 PM, Siegfried wrote:
So, after discussing some methods to import and export a CoreData database, I
ended up sticking with my initial XML idea.
Now I'm stuck in a problem when parsing that is probably simple, but I can't
solve. Basically, my XML is like this:
On Oct 15, 2010, at 2:44 PM, Chris Tracewell wrote:
NOTE :: GC Enabled
I am using an NSScanner in an NSString category but am crashing whenever I
try to log the string I scanned into or to return it. If I comment out the
NSLog there are no problems.
NSString *theScannedString;
I would
On Oct 15, 2010, at 3:42 PM, Tito Ciuro wrote:
Hello,
I'm implementing a method and I'm not sure what the behavior should be when
detecting an anomaly.
Case in point: I have a method that iterates through an array of objects. As
I traverse the array, I'm, checking whether the object in
On Sep 22, 2010, at 2:38 PM, Eric E. Dolecki wrote:
I've been asked to take the iTunes XML file from a few people and provide a
picker to choose which one to use. That's the easy part. So I have a few of
the XML files and slapped them on a server, etc. however each one averages
about 5MB in
Dear all,
I've run into the following problem, and I'm a bit stuck - I wonder if you can
shed some light on this. I have an iPhone app that uses Core Data, and the
problem occurs when the app terminates. I have an NSOperationQueue with
potentially several NSOperations that are cancelled in the
, but not the call to
objc_exception_throw.
In case it matters, this is on iPhone OS 3.1.3, Xcode 3.2.2.
Thanks,
Hank
On Jun 8, 2010, at 12:08 PM, Alexander Spohr wrote:
Is there anything in the log?
What does save's error parameter return?
atze
Am 08.06.2010 um 17:53 schrieb Hank Heijink
schrieb Hank Heijink (Mailinglists):
Dear all,
I've run into the following problem, and I'm a bit stuck - I wonder if you
can shed some light on this. I have an iPhone app that uses Core Data, and
the problem occurs when the app terminates. I have an NSOperationQueue
with potentially
On Jun 1, 2010, at 5:09 PM, Fritz Anderson wrote:
On 31 May 2010, at 11:58 PM, Development wrote:
I have a Scroll view that contains a master view. This master view adds page
sized views of image data, specifically PDF data. The problem that I am
having is that if I load all these pages
On May 22, 2010, at 11:33 AM, Angelo Chen wrote:
Hi,
I'd like to get creation date of a file, here are the codes:
NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path
traverseLink:YES]; NSLog(@Dict %@, fileAttributes);
This works if the file came from FAT or Mac OS X,
On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote:
Is it common in either Cocoa or UIKit to have an autorelease run
happen only when the user does something?
I'm in a situation where I believe the autorelease run is happening
only when I push a bush or otherwise fiddled with a UI item;
On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote:
It turns out that my memory error is coming form somewhere else. If
you don't mind changing the topic of the thread for a moment:
I have a Foo object which has an NSMutableArray of Bar objects. The
Bar objects each have their own
On Mar 20, 2010, at 1:52 PM, Gabriel Fernandez wrote:
I wanted to get a subset of an entity's attributes because one of the
ManagedObject's attributes is a large image.
You might consider another design: one that defines two entities, such that the
image attribute of your object is replaced
On Mar 8, 2010, at 10:44 PM, Philippe Sismondi wrote:
In other words, the MadeObj instance for AppController's instance variable is
created and then immediately dealloc'd. I take this to mean that the
autorelease pool it was in was released/drained. If I change the
AppController init
On Feb 19, 2010, at 2:43 PM, David M. Cotter wrote:
just before the line of code that pops up the menu, i iterate over all the
items
so yes, i am absolutely sure it is getting called
and i am absolutely sure that myMenuItem is non null
Posting you code is wildly more helpful than describing
On Feb 18, 2010, at 10:08 AM, Eric Gorr wrote:
Measure from the left edge of the window to the rightmost edge of the
maximize button: 64 pixels. I doubt you can adjust it, but who knows -
maybe if you get rid of the title bar?
Can one override the 64 pixel limit?
In Cocoa? I doubt that
On Feb 18, 2010, at 1:55 PM, Alexander Bokovikov wrote:
Hi, All,
I'm sorry if this is a stupid question, but I don't see an evident answer...
I need the subj, but don't see appropriate NSWindow method... Am I missing
something?
Implement the NSWindow delegate method -
On Feb 17, 2010, at 4:55 PM, Eric Gorr wrote:
On Feb 4, 2010, at 3:13 PM, Hank Heijink (Mailinglists) wrote:
On Feb 4, 2010, at 2:51 PM, Eric Gorr wrote:
When I am resizing my window, I have a delegate method
windowWillResize:toSize: which is being called. What I am finding odd
On Feb 9, 2010, at 9:21 AM, Donald Klett wrote:
I am trying to learn Cocoa and wrote a simple app using the MVC pattern. The
view controls two text fields, the controller receives events from a single
button, and the model receives the value entered into the first text field,
and then
On Feb 4, 2010, at 2:51 PM, Eric Gorr wrote:
When I am resizing my window, I have a delegate method
windowWillResize:toSize: which is being called. What I am finding odd is that
the width of the size being passed in will never go below 64 pixels even if
the width for contentMinSize and
If you create your data model in Xcode with its data modeling facility, you can
give it a default value right there, when you select the attribute (no need to
recreate the Player.m and Player.h files). If you need to set different default
values each time, just create the Player instance and
On Jan 12, 2010, at 2:51 PM, Rainer Standke wrote:
I am trying to get some contextinfo across while a sheet is displayed.
Here is the code that displays the sheet:
NSArray *theContextInfo = [[NSArray alloc] init];
theContextInfo = [NSArray arrayWithObject:objTBD];
You're leaking
Check the docs:
http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html
There's a section called OpenAL and Audio Interruptions that explains it.
Good luck,
Hank
On Jan 10, 2010, at 4:23
That example assumes you have an instance variable called myCustomSheet in your
class. You can tell from the method signature of the following method (called
in the example you refer to) what type it should be:
- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow
On Dec 22, 2009, at 12:51 PM, Eric E. Dolecki wrote:
I have a view which controls it's UI when rotated. However, if there is a
subView in place, it rotates and I'd like to control it's UI too. In my
subView the willAnimateRotationToInterfaceOrientation doesn't get fired. I
set up the
On Dec 14, 2009, at 1:27 PM, gMail.com wrote:
Hi,
if I compile this code against 32-bits Universal, it works.
If I compile this code against 64-bit Intel, it doesn't work.
I get a bad access error just on memcpy. What do I miss? I use:
Base SDK 10.6
i386 ppc ppc64 ppc7400 ppc970
On Nov 21, 2009, at 11:39 AM, Colin Deasy wrote:
Hey,
Thanks for the info. I'll certainly look into the CFNetwork API. I was really
hoping for a nice solution to come about for the cocoa API's but I've since
given up hope and started using libcurl, which is actually a really nice
@interface DataViewController : MainViewController {
…
NSMutableArray *records;
}
- (id) init
{
records = [[NSMutableArray alloc] init];
}
- (int) createDictionary
{
[records autorelease];
I'm assuming you're not using GC since you're looking at
On Nov 19, 2009, at 7:51 PM, Jens Alfke wrote:
On Nov 19, 2009, at 3:40 PM, Colin Deasy wrote:
This shared thread is actually handling potentially large numbers of
concurrent url connections/downloads. The reason that I want a block in some
of those at different times is a for a form of
-initWithCString:encoding: should copy the bytes. You can verify
that yourself with a small test:
char buf[10+1] = 0123456789;
NSString *s = [[NSString alloc] initWithCString:buf
encoding:NSASCIIStringEncoding];
NSLog(@before %@, s);
memset(buf, 'x', 10);
NSLog(@after %@,
On Nov 12, 2009, at 5:59 AM, Jeremy Pereira wrote:
for (NSUInteger i = 0; i nTags; i++) {
unsigned long pcLength = 0;
if (getLengthOfMetaData(fileHandle, metadataTags[i], 0,
pcLength) != 0) continue;
Religious rant first:
The above line is an abomination in my
Hi all,
I've run into a funny crash when using -[NSString
stringWithCString:encoding:]. The code in question runs in the iPhone
Simulator. I haven't found anything on the web about this, but I found
out some things by experimenting. I have a workaround, but I'm curious
what's going on.
True. I'd better check for that - thanks! However, I'd have gotten a
crash at that line, not confused memory management. I'm not catching
any exceptions that would muffle this one.
Hank
On Nov 11, 2009, at 5:07 PM, Aki Inoue wrote:
Another possibility.
Since you're asking to instantiate
On Nov 3, 2009, at 10:06 AM, marc hoffman wrote:
Hi,
im running into some very odd behavior when using a ShortStyle date
formatter for entering dates, and using single vs double digit year
numbers. typing the year as either 2009 or 09 works as expected,
but typing it as 9 not only does
I believe -[UIScreen applicationFrame] returns different values for
phone and simulator in OS 3.0. From your screenshots I have no idea if
that's your problem though. Did you layout your view in IB or did you
do that programmatically?
Best to set a breakpoint where you position your
I second the previous poster's opinion: view controllers are
definitely the way to go here. They'll let you take care of rotation
and plenty of other stuff: read the view controller programming guide.
Using a view controller gives you many more places to customize what
happens.
There's
to store something
in userInfo that tells me or helps me definitively find the correct
Cell to update ...
Thanks,
-Luther
On Wed, Sep 16, 2009 at 8:08 PM, Hank Heijink (Mailinglists) hank.l...@runbox.com
wrote:
On Sep 16, 2009, at 8:24 PM, Luther Baker wrote:
I'd like to fire a simple
On Sep 16, 2009, at 8:24 PM, Luther Baker wrote:
I'd like to fire a simple callback every .1 of second (yes, my
stopwatch
style app). But in that callback, I need access to a corresponding
UITableViewCell. Unfortunately, I don't see a way to choose a
selector with
a UITableViewCell
Do you want help guessing or help solving? If you're after the latter,
you should post your code.
Hank
On Sep 7, 2009, at 9:10 PM, Development wrote:
Ok I have the weirdest UITableViewBug..
I've set up the delegate, datasource, etc. My data appears correctly
in the table. HOWEVER, when I
On Aug 24, 2009, at 8:20 PM, Agha Khan wrote:
HI:
I know the leak is in next 2 lines
I have commented all the code except these 2 lines.
// NSTimeInterval
NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
unsigned unitFlags = NSYearCalendarUnit |
I seem to remember you do iPhone development, so I'll answer from
there, inasmuch as I can: you're not giving us much to work with here.
As to your last question: there is no way to gracefully exit the
application. On an iPhone, you can't force an exit that doesn't look
like a crash to the
I have removed both function but now my device doesn't know if it is
in horizontal or vertical position. I need that information to
arrange some controls according to its Orientation.
The first parameter of the
willAnimateRotationToInterfaceOrientation:duration: method should tell
you
This is new in iPhone OS 3.0. From the documentation for
UIViewController:
- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:
(UIInterfaceOrientation) toInterfaceOrientationduration:
(NSTimeInterval)duration
[...]
The default implementation of this method does nothing. If you
If one of your buttons is always hidden, why do you need two buttons?
You can just use one button and change the title, target, and action
when you need to. If necessary you can even replace the whole button.
Hank
On Aug 6, 2009, at 1:47 AM, Agha Khan wrote:
Hi:
I have a UINavigationBar
Completely transparent views (opacity 0.0) don't receive touch events
- you're not missing anything there. As you have found, a little
opacity is enough to catch them again. Depending on what's in your
view, you might be able to set the background color to [UIColor
clearColor] to get the
Have a look at the Witap code sample. It finds other iPhones over
Bonjour and connects sets up a socket connection (I believe it uses
CFNetwork, but I don't have it handy right now). If you need more
info, look at the CFNetwork programming guide - CFNetwork isn't that
bad, and the guide
This question would be more appropriate on the iPhone Dev Forums.
That said, read the iPhone Application Programming Guide, http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/
- specifically the section on communicating with other applications
On Apr 8, 2009, at 8:24 AM, fawad shafi wrote:
i m working on sqlite3 database, problem is this that, when i insert
data in database from simulator, n after this when i go to sqlite3
terminal. the data is not available there.
more strange is that after inserting data from simulator, when
1) If the default implementation does nothing, why must I invoke
super when overriding this method?
You're right, that's confusing. Could be several answers though: maybe
super does nothing visible, but still something; or maybe super could
start doing something in the future. It's better
Hi all,
I'm having some trouble figuring out a bindings problem. I've made a
litle test project that shows the problem (http://www.hankheijink.com/TestTextfieldBindings.zip
, it's a 64Kb file). This is the structure of the project:
I've got an NSCollectionView wired up so that it gets its
Look into UpdateSystemActivity(). It's in the CoreServices framework.
If you call it with UsrActivity every 25 seconds or so, the display
won't dim and the computer won't go to sleep (unless it's forced to.
You can't prevent that).
What is your app doing that you want to resort to
Try the NSObject method -doesNotRecognizeSelector:
The runtime system invokes this method whenever an object receives an
aSelector message it can’t respond to or forward. This method, in
turn, raises an NSInvalidArgumentException, and generates an error
message.
Hank
On May 23, 2008, at
On May 21, 2008, at 9:46 AM, Michael Ash wrote:
I agreed to similar contracts every time I've installed Mac OS X and
Xcode and nobody ever got annoyed when I talked about *those* in a
public forum.
You agreed, not agreed. Checking the box is legally binding. It
doesn't matter if you've
On May 21, 2008, at 12:05 PM, john darnell wrote:
- (id) init
{
cityArray = [[NSArray alloc] init];
NSString *c0 = @New York; //Ten NSString objects created here
...
NSString *c9 = @Virginia Beach;
cityArray = [NSArray arrayWithObjects: c0, ...c9, nil];
return self;
}
Here's
On May 21, 2008, at 12:49 PM, Gérard Iglesias wrote:
with an empty NSArray (not very useful, since you can't add items to
an NSArray). Then, you leak that allocated memory by setting
cityArray
to an autoreleased NSArray
In fact it is not leaking, it is just creating an object for
I don't know how many times this has already come up: until the NDA is
lifted, you can't ask questions about the iPhone SDK on this list.
On May 15, 2008, at 12:52 PM, Stuart Carnie wrote:
If I want to implement my own keyboard, I'd like it to behave
similarly to
the built-in iPhone
+[NSString stringWithUTF8String:] is what you're looking for. I
*think* UInt8 and char are always the same size, but I'm not 100% sure
if you can always depend on that. If you can, you can just feed your
UInt8 array to the function.
Hope this helps,
Hank
On May 5, 2008, at 8:17 AM, Marc
Are you sure self.dependencies isn't returning nil? That'd explain it.
Hank
On Apr 12, 2008, at 10:42 PM, K. Darcy Otto wrote:
My code used to look like this:
NSMutableArray *newDependencies = [self.dependencies mutableCopy];
[newDependencies addObjectsFromArray:[aDependency
This seems like a lot of trouble to go to. Why not do something like
this?
NSString *inString = @64.123456%;
NSString *outString = [NSString stringWithFormat:@%.2f%%, [inString
doubleValue]];
Hank
On Apr 8, 2008, at 11:07 AM, Lorenzo Thurman wrote:
I have the string representation of a
Just checking the obvious here - is it possible that your worker
thread completes its work so fast that the main run loop hasn't
updated the screen once before it's done? Keep in mind that the main
thread has to display your window with the progress bar and the text
and (depending on your
to tone down the update speed.
Hank
Hank Heijink (Mailinglists) wrote:
Just checking the obvious here - is it possible that your worker
thread completes its work so fast that the main run loop hasn't
updated the screen once before it's done? Keep in mind that the
main thread has to display
On Mar 13, 2008, at 9:19 AM, Daniel Luis dos Santos wrote:
NSDictionary *index = [NSDictionary dictionaryWithContentsOfFile:
indexFilePath];
This dictionary is autoreleased when it's given to you, hence the
error when you try to release it. Refer to
It's a little busy at the developer website, since they just announced
the iPhone SDK. I think there's nothing to do but wait...
Best,
Hank
On Mar 6, 2008, at 4:05 PM, Joshua Preston wrote:
Hey guys,
First, let me say that I'm just starting to pick up Cocoa and
Objective-C, and so far, I
76 matches
Mail list logo