How to update table while in a method

2009-11-12 Thread Ashley Perrien
I have an application that has a table of various internet resources and 
information on them. What I would like to be able to do is:

for (netResource *resource in anArrayOfResources) {
[resource updateInfo];
[resultsTable reloadData];
}

But it seems that the table refuses to redraw until after everything has been 
updated. So when I do this process, I get the spinning cursor for a few second 
(looks like it hung) and then the table updates. I'd prefer the table to update 
as information comes in. Note that I'm not using any bindings in this. 

I tried spinning off the table update into a new NSOperationQueue and that 
didn't help so I'm assuming spinning the resource update to another queue also 
wouldn't help either. Any suggestions?

Ashley

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Reading NSInputStream

2009-10-21 Thread Ashley Perrien
I'm writing a small application to get info from a mail server and  
having lots of problems with reading from NSInputStream.  After  
initiating a connection (getStreamsToHost) I don't get an event that  
the input stream has bytes available, if I check it, it returns NO but  
if I go ahead and read it anyway, I get the usual banner. I'm also  
unable to get the buffers working.


So 1) I can't get this working at all:

uint8_t *readBuffer;
unsigned int bufferLength;
BOOL gotBuffer = [readStream getBuffer: readBuffer length:  
bufferLength];


The last line always says arguments 1 and/or 2 are incompatible  
pointer type. I've tried every combination of * and , no luck.


If instead I go with NSData:

if ([readStream hasBytesAvailable])
NSLog(@Has Bytes);
else
NSLog(@No Bytes);

NSMutableData *returnMessage = [NSMutableData dataWithLength: 300];
[readStream read: [returnMessage mutableBytes] maxLength: 300];
NSString *readData = [[NSString alloc] initWithBytes: [returnMessage  
bytes] length: 300 encoding: NSUTF8StringEncoding];

NSLog(@Read: %@, readData);

I get:
No Bytes
Read: 220 mx.google.com ESMTP...

So, how do you go about finding out if there's something available,  
getting a buffer and reading into it? I've searched the archives and  
google, copy and pasted the code and it still returns errors or gets  
results that don't make sense (no bytes available but they read in  
fine).



Ashley Perrien

P.S. I know there are other mail frameworks out there, I'm not looking  
to actually send and receive anything substantial,  just want to  
reliably connect to the server, send ehlo or .capability and capture  
the result, that's all. I've been beating my head against a wall for a  
while now trying to get it to work without knowing if there's actually  
data to be read and how best to do it.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Reading NSInputStream

2009-10-21 Thread Ashley Perrien
After initiating a connection (getStreamsToHost) I don't get an  
event that the input stream has bytes available, if I check it, it  
returns NO but if I go ahead and read it anyway, I get the usual  
banner.


It sounds like you didn't call -scheduleInRunLoop:forMode: ?


Covered. See below for full code.


uint8_t *readBuffer;
unsigned int bufferLength;
BOOL gotBuffer = [readStream getBuffer: readBuffer length:  
bufferLength];
The last line always says arguments 1 and/or 2 are incompatible  
pointer type. I've tried every combination of * and , no luck.


Try declaring bufferLength as NSUInteger, as it's declared in the  
docs and header.


D'oh, thanks, that fixed that problem. Still getting strange issues  
though with this code:


[NSStream getStreamsToHost: mailHost port: mailPortNumber inputStream:  
readStream outputStream: writeStream];


mailHost and mailPortNumber are imap.gmail.com and 587 if that matters  

Both streams are retained, setDelegate: self, scheduleInRunLoop and  
open.


if ([readStream hasBytesAvailable])
NSLog(@Has Bytes);
else
NSLog(@No Bytes);

This always returns No Bytes

uint8_t *readBuffer;
NSUInteger bufferLength;
	BOOL gotBuffer = [readStream getBuffer: readBuffer length:  
bufferLength];


gotBuffer always == NO and bufferLength of 0.

int len = [readStream read: readBuffer maxLength: 300];

len always == 0 and the buffer is empty.

NSMutableData *returnMessage = [NSMutableData dataWithLength: 300];
[readStream read: [returnMessage mutableBytes] maxLength: 300];
	NSMutableString *readData = [[[NSMutableString alloc] initWithBytes:  
[returnMessage bytes] length: 300 encoding: NSUTF8StringEncoding]  
autorelease];

NSLog(@Read: %@, readData);
return readData;

This will always work as expected:
Read: 220 mx.google.com ESMTP...
But only if I don't read from the stream twice. If all of the above  
code is run, it fails with Program received signal:   
“EXC_BAD_ACCESS”. If I comment out the int len = [readStream...  
section, the NSMutableData section reads fine and gets data.


It's almost is if the NSMutableData is making it up but the docs say  
dataWithLength returns a zeroed out object.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa-dev Digest, Vol 6, Issue 1522

2009-10-21 Thread Ashley Perrien
Really can't tell, because you're only posting isolated code  
fragments, instead of complete and self-contained fragments that  
show the entire context.


So here's the unadulterated method I'm trying to get working (not very  
useful at this point but if I can get the reading right):


-(void) openConnection {
// next 4 lines are actually set up elsewhere
NSHost *mailHost = [NSHost hostWithName: @mail.me.com];
int mailPortNumber = 143;
NSInputStream *readStream;
NSOutputStream *writeStream;

	[NSStream getStreamsToHost: mailHost port: mailPortNumber  
inputStream: readStream outputStream: writeStream];


[readStream retain];
[readStream setDelegate: self];
	[readStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:  
NSDefaultRunLoopMode];

[readStream open];

[writeStream retain];
[writeStream setDelegate: self];
	[writeStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:  
NSDefaultRunLoopMode];

[writeStream open];

BOOL youWantThisToWork = YES;

if (youWantThisToWork) {
NSMutableData *returnMessage = [NSMutableData dataWithLength: 
300];
		int bytesRead = [readStream read: [returnMessage mutableBytes]  
maxLength: 300];
		NSMutableString *readData = [[[NSMutableString alloc] initWithBytes:  
[returnMessage bytes] length: 300 encoding: NSUTF8StringEncoding]  
autorelease];

NSLog(@Read: %d bytes\n%@, bytesRead, readData);
}
// Output: Read: 300 bytes \n * OK [CAPABILITY mmp0841 IMAP4.

else {

if ([readStream hasBytesAvailable])
NSLog(@Has Bytes);
else
NSLog(@No Bytes);

uint8_t *readBuffer;
NSUInteger bufferLength;
		BOOL gotBuffer = [readStream getBuffer: readBuffer length:  
bufferLength];


if (gotBuffer) {
int len = [readStream read: readBuffer maxLength: 
bufferLength];
if (len = 0)
NSLog(@nothing read);
else
NSLog(@Read: %@, [[[NSString alloc] initWithBytes: readBuffer  
length: bufferLength encoding:NSUTF8StringEncoding] autorelease]);

}
else {
NSLog(@Did not get a buffer);
}
}
// Output: No Bytes , Did not get a buffer
	// This second section is what I'd like to get working So I can  
actually have some error checking in the code rather than just reading  
and hoping something comes in and it doesn't hang.

}



[readStream read: [returnMessage mutableBytes] maxLength: 300];


You're neglecting the return value, which indicates the actual  
number of bytes read.  You're probably lucking out that the  
mutableBytes have been zeroed, so any data less than 300 bytes ends  
up with a terminating nul character.


I'm not entirely sure why you mention the null character. Even if I  
change the above code to only read 10 bytes the output is:

Read: 10 bytes
* OK [CAPA
So even if all 10 bytes are actually data, it reads it fine. My  
question is, when there obviously is data there to be read  
hasBytesAvailable returns no and so does getBuffer. But if I just grab  
the stream and push it into a data object, it works fine until there  
actually isn't data available and then it just hangs.


I really appreciate any help with this. I'm fairly comfortable with  
cocoa but VERY new to trying the networking side of it. I assume I'm  
missing something small, I just can't figure out what it is.


Ashley
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Need simple port scan

2009-09-07 Thread Ashley Perrien
I'm very new to networking via cocoa and need to develop a small port  
scanner application. The core of it is very simple, is address 1.2.3.4  
listening on port X. I've done a bit of looking on NSStream, pipes,  
tasks and such but hopefully what I'm trying to get is a short and  
sweet. What specifically should I be checking into or does anyone  
happen to have a snippet of code that does the above?


Ashley Perrien
Random Quote of the day:
No prizes for predicting rain. Prizes only awarded for building arks.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need simple port scan

2009-09-07 Thread Ashley Perrien
I'm very new to networking via cocoa and need to develop a small  
port scanner application. The core of it is very simple, is address  
1.2.3.4 listening on port X.


Does it have to be a Cocoa API?  You should be able to use the Unix  
BSD sockets API, which IMHO if you're looking for short and sweet  
you might as well use.


Doesn't need to be cocoa I guess, as long as it ends with a yes or no,  
that should be fine.


If you really want a Cocoa API, then I think NSSocketPort is  
probably what you're looking for.  Alternatively, use NSStream's  
class method + getStreamsToHost:port:inputStream:outputStream:.


I'll look at that again but when I did before it seemed to need lots  
of support around it (creating pipes and streams, archiving data to  
files, etc.) that I was hoping to avoid having to learn about, or find  
some kind of simple tutorials on it as much of that is well beyond  
what I've been doing thus far.


Ashley


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Binding to table with variable number of columns

2009-03-07 Thread Ashley Perrien
I've currently got a couple tables set up that have a variable number  
of columns in them depending on the data on the back end. They're  
purely displaying info and will not be used for editing it at all. At  
the moment I have 1 method that creates and adds the columns to the  
table and then the 2 standards for the number of rows and what to show  
at each row/column.


How would I go about setting up bindings to a table in this kind of a  
situation if I can't predict in IB how many columns it will have? The  
main reason I have for trying to switch to bindings is to (hopefully)  
simplify sorting.


Ashley Perrien
Random Quote of the day:
We're not surrounded, we're in a target-rich environment!


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Simple way to traverse 2D array?

2009-02-23 Thread Ashley Perrien
I'm hoping there's a simple way to do this or perhaps I can get some  
ideas on which direction to go. I've built a 2D NSArray of NSArrays.  
The primary array will be of variable length (usually less than 10)  
and the secondary arrays will also be variable, usually less than 5,  
but each one may be different, the first may be 2, the second may be  
3, etc. I need to traverse them and build all the unique combinations  
of the elements.


For instance, I have
NSArray *numbers containing 1,2 and 3
NSArray *letters containing A and B
NSArray *colors containing Red, White, Blue.

I need to build an array of objects we'll call combos:
combo1: 1, A, Red
combo2: 1, A, White
combo3: 1, A, Blue
combo4: 1, B, Red
combo5: 1, B, White
.
.
.
combo18: 3, B, Blue

This is relatively easy if I know how many arrays I'm working with (3  
in this case) to simply nest the for loops but if I don't know how  
many arrays the primary array has, I can't think of a way to nest the  
loops if I don't know how deeply to nest them. Any suggestions on the  
best way to approach something like this?



Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Getting pixel color from NSView

2009-01-25 Thread Ashley Perrien
Is there a way to get the color of a pixel or area of an NSView during  
the drawRect method? I'll be tiling the view with a grid of random  
colors but each tile is based on the colors around it. I'd prefer to  
call something along the lines of:


NSColor *aColor = [myView colorAtPoint: somePoint];

Rather than creating and filling a potentially quite large array of  
colors.


-Ashley
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Accessing interface elements (iPhone vs Mac)

2009-01-20 Thread Ashley Perrien
I'm currently fairly comfortable with Mac development but still  
struggling to learn iPhone. I'm seeing differences in how things are  
coded and I'm not seeing many explanations as to why the difference.  
For instance, on the Mac, in Interface Builder, I have a text field, I  
link it up with the code using:


@interface someClass : NSObject
{
IBOutlet NSTextField *myLabel;
}

Then in the implementation I can call [myLabel setStringValue:  
@something new]. No need to create the methods, alloc, init or  
release anything, etc.


In iPhone examples many or all of them have:

@interface myViewController : UIViewController
{
   IBOutlet UILabel *myLabel;
}

@property (retain, nonatomic) UILabel *myLabel;

and then @synthesize myLabel in the implementation. I've even seen  
where the dealloc method will then release the object.


I believe I've tried it and the property and synthesize are not  
NECESSARY for it all to work; so is having it in there of some kind of  
benefit for the iPhone or is it just a quirk of how developer X likes  
to do things? I've seen some discussions about how the autorelease  
pool shouldn't be used as much on the iPhone and ideally you should  
alloc and then later release things for tighter memory control. That  
makes sense. Is there something similar with the above, is there a  
back-end reason to property, synthesize and release things that were  
created in IB?



Ashley Perrien
Random Quote of the day:
One way to get high blood pressure is to go mountain climbing over  
molehills.

-Earl Wilson


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Best way to get messages OUT

2008-12-26 Thread Ashley Perrien
I'm still relatively new to Cocoa (and programming in general) and  
very new to iPhone but this is more of a general question I've been  
struggling with.


What is the best / most accepted way to get a message out of an object?

Scenario 1:
I have a document application with an NSView that is basically a graph  
of a subset of the data in the document. I'd like to bo able to drag  
within the graph and have it change what data it's showing. How would  
I send a message from the view to the document either telling it to  
update the selection or to request new data? Delegate? Notification?  
Other?


Scenario 2:
iPhone app (extremely simple, one view) again with data and a graph of  
that data. when interacting with the UIView, how do I tell the parent  
view that something needs changing?


Basically, what's the best way for an ivar object to communicate with  
it's parent?



Ashley Perrien
Random Quote of the day:
If you understand what you're doing, you're not learning anything.
-Abraham Lincoln


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Working with mathematical errors

2008-07-27 Thread Ashley Perrien
What is the most common/accepted way of dealing with the inaccuracies  
of floating point math? I'm trying to find out 1) Do 2 NSBezierPath  
lines intersect and then 2) What is the point of the intersection?


Given a couple points on a line I can find the intersection point but  
since 2 line segments may not intersect, I then check:

if([lineOne containsPoint: intersectionPoint])

That will nearly always fail unless the math works out to very nice,  
neat, round numbers. I've seen one possible workaround of multiplying  
everything by 100 and then doing integer math but considering I've got  
some division involved, not sure exactly if that would work. I guess I  
could just check the values myself (if point1 is +- .001 of point2)  
but that seems kinda hackish.


What's the most common way of dealing with these types of problems?

Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSView colors

2008-07-25 Thread Ashley Perrien
I have a custom NSView that contains as an instance variable a color.  
If I set the color in init as lineColor = [NSColor blueColor]; all is  
well. If instead I use [NSColor colorWithCalibratedRed: 0.5 green: 0.5  
blue: 1.0 alpha: 1.0], the program crashes if I try and access or  
change the color later. The initial draw using it is just fine. But  
the next time it's redrawn or if I change the color, everything  
crashes. I have the exact same problem in 2 completely different  
applications. I'd like to be able to initialize the colors with  
something other than the default redColor, blueColor, etc. I've also  
tried one or two of the other ways to specify values and have had the  
same problem. Any ideas on what's going on?


Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Drawer examples?

2008-07-19 Thread Ashley Perrien
I've just learned how to directly access custom views and am not  
trying to set up an application with a drawer that has a custom view  
in it (along with a few other items). I can get the drawer to work  
properly but am having no luck with getting the custom view within the  
drawer to redraw except by closing and reopening it. I throw  
setNeedsDisplay: YES at it from everywhere I can think of and it just  
won't redraw.


The larger problem is I can create and set up the drawer in IB and set  
up bindings with text fields but I've no idea how to go about  
accessing the various items in the drawer. I can't figure out how or  
even if I need to wire up the connections like with normal windows. I  
create IBOulets and actions and when control dragging they don't show  
up. Are there any simple examples out there that show how to access  
the items in a drawer? I'm going this from a document based app if  
that matters.


Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Clock-like looping

2008-06-29 Thread Ashley Perrien
Is there a fairly simple way of setting up a clock style looping of  
numbers? Where 1-12 act normally but 11 + 2 would return 1 and so on.  
I'm not doing time and would be dealing with ranges from 1 to 96, 77,  
120, that type of range. Would also need to be able to handle partial  
numbers (4.125 for instance). Any tips on where to look or is it just  
a lot of manual checking to make sure the number are within the  
correct range?


Ashley
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


ObjectController and ArrayController tutorials

2008-06-14 Thread Ashley Perrien
Does anyone have any tips on where to get a tutorial or walkthrough  
explaining controller objects? I've read and done the example in  
Hillegass' book at least 5 times and read over the Apple docs about  
bindings and still have a VERY tenuous grasp as to what they  
(NSObjectController) are, how they work or how to configure them in  
IB. Bindings I get and don't have a problem with. Creating my own  
controller object I have no problem creating and getting to work. But  
the black box of NSObject or ArrayController I just can't figure out.  
I've also tried looking at some sample projects but without the  
explanations of how and why they were set up like they are, they just  
don't help.


Ashley
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 1040

2008-06-12 Thread Ashley Perrien

In the original example, myNum was being passed as a argument rather
than having a message to sent to it and it’s often not safe to pass
nil objects as arguments.


Hmmm... well, what's the function it's passed to going to do with it,
other than call a method on it? If it's doing anything else, it's
breaking other (much stronger) rules.


Okay, so question 2: what else could be done other than calling  
methods on it? I'm using NSNumbers in place of ints, floats and so on  
partly as a learning exercise and partly to make it easier to convert  
the number types rather than casting them. The library I had put  
together (which was just an object with no instance variables)  
originally used all floats (it's a math heavy library).


Ashley___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


argument checks

2008-06-11 Thread Ashley Perrien
Noob question: I'm putting together a small code library and I'm  
trying to include some error checking in the methods; what I want to  
protect against is the following:


NSNumber *myNum;

// Lots of code where I've forgotten to actually do anything with myNum

results = [myClass someCalculationUsing: myNum];

myNum in this case is an object and does exist but it's not a valid,  
usable argument. So in the implementation I'd like to have something  
along the lines of:


if (myNum == nil)
NSLog(@some error message);

but can't figure out what to check for that would get me into the  
error message condition. Any suggestions?


Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Hillegass book memory question

2008-06-02 Thread Ashley Perrien
I'm working my way through the 3rd edition and have a question  
specifically on speech synthesizer in chapter 5. It's my understanding  
that whenever something is retained or alloced they eventually need to  
be released. In the application built in the chapter,  
NSSpeechSynthesizer is alloced and an array is retained and neither  
are released. I know that for the very small and simple apps here, it  
doesn't really matter but how and where would you go about releasing  
those objects? If they shouldn't be released, why not?


Thanks for any enlightenment.

Ashley Perrien
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Xcode - IB problems

2008-06-01 Thread Ashley Perrien
I'm working my my way though the new edition of Cocoa programming and  
am having some problems with XCode and Interface Builder.

1) I'll create a project in XCode and save.
2) switch to IB (via the MainMenu.nib to get the layout down. Save.
3) Create a new class in XCode, put in a few IBActions and Outlets,  
save.

4) Back to IB, drag over an object, set it to the correct class.
5) SOMETIMES the Actions and/or the outlets will show up and sometimes  
not. I can see no pattern but more often than not, they don't. This  
latest project I followed exactly the steps and code in the book, none  
of the actions or outlets showed up. I threw out the project and  
recreated it. This time the actions showed up (but no outlets).


Am I doing something wrong and missing it or is this way of doing  
things just not as reliable? Should the class be created before ever  
going to IB? Should I create all the actions and outlets in IB and let  
it create the class?



Ashley Perrien
Random Quote of the day:
If you understand what you're doing, you're not learning anything.
-Abraham Lincoln


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Xcode - IB problems

2008-06-01 Thread Ashley Perrien
Usually, when I have the trouble described by the OP, I have some  
typos in my .h files for the classes.


Which was the problem here, only noticed it a few minutes after  
sending the email. I think I'm just forgetting some basic syntax  
peculiarities. Sorry for the clutter.


Ashley Perrien
Ponder This:
Success is relative. It is what we can make of the mess we have made  
of things.

-TS Eliot


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]