On Aug 4, 2009, at 11:38 PM, aaron smith wrote:
if I receive an NSValue object, how can I find out if the value it
contains is a point/rect/size/ etc. I can't figure out what to compare
it with, and can't figure out if the objCType is something I can use
for that problem. Any ideas?
This:
htt
thanks for the info. I'm trying to put it all together. help me out?
I've tried a couple diff things, here's what Im trying..
NSPoint thePoint2 = NSMakePoint(30.0,35.0);
//NSValue *test = [NSValue valueWithBytes:&thePoint2 objCType:@encode(NSPoint)];
NSValue *test = [NSValue valueWithPoint:thePoi
ah. I got it. Here's what I did. this seems like the slickets or
standard way to go:
NSPoint thePoint2 = NSMakePoint(30.0,35.0);
NSValue *test = [NSValue valueWithBytes:&thePoint2 objCType:@encode(NSPoint)];
if(strcmp((const char *)[test objCType],(const char *)@encode(NSPoint))==0) {
}
On Wed, A
On 5 Aug 2009, at 09:15, aaron smith wrote:
thanks for the info. I'm trying to put it all together. help me out?
I've tried a couple diff things, here's what Im trying..
if([test objCType] == @encode(NSPoint)) printf("test is an NSPoint");
AFAIK @encode(), unlike @selector(), doesn't try to
On Aug 4, 2009, at 7:10 PM, Sandro Noel wrote:
Is there a cocoa or carbon framework that would allow my software to
hook onto the system main event queue, like in windows?
or to hook into the window manager.
I would like to peek at every message that traverse the main queue.
Do you mean jus
I need to produce 15 random numbers between 1 to 16 without repeating any
number. I used the code like
int i,j;
for(i=0;i<15;i++){
j =random() % 15 +1;
NSLog(@"No: %d => %d \n",i,j);
srandom(time(NULL)+i);
}
But some numbers are repeating.
How can I do it wi
On Aug 5, 2009, at 6:44 AM, Mahaboob wrote:
I need to produce 15 random numbers between 1 to 16 without
repeating any
number.
...
How can I do it without repeating the numbers?
Here, try this:
http://tinyurl.com/lo6tp4
--
I.S.
___
Coc
On Aug 5, 2009, at 5:44 AM, Mahaboob wrote:
I need to produce 15 random numbers between 1 to 16 without
repeating any
number. I used the code like
int i,j;
for(i=0;i<15;i++){
j =random() % 15 +1;
NSLog(@"No: %d => %d \n",i,j);
srandom(time(NULL)+i);
}
But some nu
On 5 Aug 2009, at 11:44, Mahaboob wrote:
I need to produce 15 random numbers between 1 to 16 without
repeating any
number. I used the code like
int i,j;
for(i=0;i<15;i++){
j =random() % 15 +1;
NSLog(@"No: %d => %d \n",i,j);
srandom(time(NULL)+i);
}
But some numbe
On 05/08/2009, at 6:27 PM, Alastair Houghton wrote:
Usually when you're using NSValue, you already know what type you're
dealing with. If you have a situation where you need to distinguish
between several different things, you might be better off making
some wrapper classes (or maybe subc
On 05/08/2009, at 8:44 PM, Mahaboob wrote:
I need to produce 15 random numbers between 1 to 16 without
repeating any
number. I used the code like
int i,j;
for(i=0;i<15;i++){
j =random() % 15 +1;
NSLog(@"No: %d => %d \n",i,j);
srandom(time(NULL)+i);
}
But some nu
Dave, Ken thank you very much for the information.
what I would like to do is broad range, get information about every
action for every application in my current desktop session.
Window movement, hide, show, activate, deactivate, open, close, mouse
movement, drag and drop operations, contex
On Aug 5, 2009, at 9:50 AM, Sandro Noel wrote:
what I would like to do is broad range, get information about every
action for every application in my current desktop session.
Window movement, hide, show, activate, deactivate, open, close,
mouse movement, drag and drop operations, contextual
On Aug 4, 2009, at 11:20 PM, Matteo Manferdini wrote:
I created a mapping model and
called addPersistentStoreWithType:configuration:URL:options:error:
with the NSMigratePersistentStoresAutomaticallyOption option.
Did you create a mapping model?
If not, did you specify the NSInferMappingModelA
You need to do remote debugging, you can look up how to accomplish
this, I did it some years ago and don't remember.
Look at the Cocoa and Carbon APIs and make educated guesses as to what
would be called when for example, a contextual menu is to be displayed.
Set a break point on that API.
Dear Mahaboob:
Many people have answered this question but I will take this route.
First of all you only have call srandom once in you program. Best
place is when you are going to load the object.
I defined 2 macros
#define RANDOM_SEED() srandom(time(NULL))
#define RANDOM_INT(__MIN__, __MAX_
Hi:
I need 2 alerts in my class
Code taken from (the iPhone Developer's Cookbook) and works fine with
if you have only one alert.
When user presses Ok/Cancel button it (void)alertView:(UIAlertView
*)alertView activates function.
- (void) presentSheet
{
UIAlertView *alert = [[UIAle
In your delegate, method, do this:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:
(NSInteger)buttonIndex {
if ([[alertView title] isEqualToString:@"Some Title"]) {
...
return;
} if ([[alertView title] isEqualTo
On Aug 5, 2009, at 12:08 PM, Agha Khan wrote:
Hi:
I need 2 alerts in my class
Code taken from (the iPhone Developer's Cookbook) and works fine
with if you have only one alert.
When user presses Ok/Cancel button it (void)alertView:(UIAlertView
*)alertView activates function.
[snip]
Now I
On Wed, Aug 5, 2009 at 11:08 AM, Agha Khan wrote:
> How can we distinguish which alert we are talking about?
You are given the alert as the first argument of the delegate method.
What more could you possibly want? Stuff it in an ivar and do an
equality check.
--Kyle Sluder
__
Sandro Noel wrote:
what I would like to do is broad range, get information about every
action for every application in my current desktop session.
Dtrace?
Try google keywords:
dtrace mac os x
-- GG
___
Cocoa-dev mailing list (Cocoa-dev@list
On Wed, Aug 5, 2009 at 11:16 AM, Chase Meadors wrote:
> if ([[alertView title] isEqualToString:@"Some Title"]) {
In addition to this being very bad style, I take it you've never
written a localized application?
--Kyle Sluder
___
Cocoa-dev mailin
This is not a cocoa question and is a basic C question. The simple
solution is to keep a 2nd array of numbers already generated.
Sent from my iPhone
On Aug 5, 2009, at 3:44 AM, Mahaboob wrote:
I need to produce 15 random numbers between 1 to 16 without
repeating any
number. I used the cod
I am making an analog clock, and I have 3 PNGs for the arms. I am rotating
these, but they look awful with blocky edges. The second hand is a pixel
wide for instance. Is there a trick to use smoothing (aliasing) or
something?
Here is the method I call via NSTimer every second. Is there a better
I prefer to use the .tag property and set a constant for them.
On Aug 5, 2009, at 1:16 PM, Chase Meadors wrote:
In your delegate, method, do this:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:
(NSInteger)buttonIndex {
if ([[alertView title] isEqualToString:@"Some
I'm trying to get a value for a specific variable to tell if a
transaction is complete on iphone. In the didFinishLoading delegate
method I have placed this code:
NSString * aString =[theWebView
stringByEvaluatingJavaScriptFromString
:@"document.getElementsByName(\"encrypted\").value"];
Greetings:I need to adjust a UILabel's width per with of its text.
What I did was to get the text's length via [NSString length]. Of course,
the displayed UILabel width is too narrow to fully display the actual
string.
So I believe I need to compute the true width based on the number of
font-
On Aug 5, 2009, at 3:46 PM, Frederick C. Lee wrote:
Greetings:I need to adjust a UILabel's width per with of its text.
What I did was to get the text's length via [NSString length]. Of
course,
the displayed UILabel width is too narrow to fully display the actual
string.
So I believe I n
On Aug 5, 2009, at 1:46 PM, Frederick C. Lee wrote:
Greetings:I need to adjust a UILabel's width per with of its text.
What I did was to get the text's length via [NSString length]. Of
course,
the displayed UILabel width is too narrow to fully display the actual
string.
So I believe I n
On 5 Aug 2009, at 17:54, Agha Khan wrote:
Dear Mahaboob:
Many people have answered this question but I will take this route.
First of all you only have call srandom once in you program. Best
place is when you are going to load the object.
While this entire thread should never have been on *
Interesting.I finally tried: [NSString sizeWithFont:<>] as follows.
CGSize strSize = [item.title sizeWithFont:[UIFont
systemFontOfSize:TEXT_FONT_SIZE]];
CGRect centralTitleRect = CGRectMake(TITLE_OFFSET, (rowHeight -
TITLE_LINE_HEIGHT)/ 3.0, strSize.width, TITLE_LINE_HEIGHT);
UILabel *titleLabe
On 5 Aug 2009, at 2:08 PM, Development wrote:
I'm trying to get a value for a specific variable to tell if a
transaction is complete on iphone. In the didFinishLoading delegate
method I have placed this code:
NSString * aString =[theWebView
stringByEvaluatingJavaScriptFromString
:@"docum
Greetings:
The default selection color is blue. I want to use a different color
upon user selection. Here's my code:
(void)tableView:(UITableView *)theTableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [theTableView cellForRowAtIndexPath:indexPath
The html is pretty straight forward. It is created with php and is as
follows when you view source from the page:
it is also within a form.
the UIWebView is built in IB and linked up. It loads correctly and the
'real' page passes it's variables along to the next correctly. The
webview e
On Aug 5, 2009, at 2:08 PM, Development wrote:
I'm trying to get a value for a specific variable to tell if a
transaction is complete on iphone. In the didFinishLoading delegate
method I have placed this code:
NSString * aString =[theWebView
stringByEvaluatingJavaScriptFromString
:@"d
On Aug 4, 2009, at 4:42 PM, Shawn Erickson wrote:
On Tue, Aug 4, 2009 at 11:13 AM, Luke the Hiesterman> wrote:
On Aug 4, 2009, at 11:10 AM, James Lin wrote:
Bonjour is for local area network, right?
No, Bonjour is applicable to any networking, local or wide area.
Here's some
sample code
On Aug 4, 2009, at 4:42 PM, Shawn Erickson wrote:
Of course, in the context of the original question (re: iPhone
networking), the iPhone is almost never going to have a public IP
address (being hidden behind WiFi or cell phone NATs).
Assuming cell carriers don't get off their butts and imp
Hi Everyone:
I am wondering if anyone knows of a way to disable Exposé in SystemUIMode.
I am using this class to create a kiosk-based application and don't want the
user to be able to switch between other windows. If there isn't a way to do
this inside the class, is there another class that can a
Thanks for the info. Yeah I have a method right now that accepts
NSValue, and I'm figuring out what is in the value. But I'm going to
add methods that explicitly require NSPoint, etc. Thanks again for the
help, much appreciated. -A
On Wed, Aug 5, 2009 at 4:13 AM, Graham Cox wrote:
>
> On 05/08/200
My application has a dynamic segmented control, where the user can
specify that each segment has an icon, text, or both. However I am
having trouble correctly resizing a segment.
According to the docs, calling
- (void)setWidth:(CGFloat)width forSegment:(NSInteger)segment
with 0 for the widt
On Aug 5, 2009, at 8:45 PM, Pierce Freeman wrote:
I am wondering if anyone knows of a way to disable Exposé in
SystemUIMode.
I am using this class to create a kiosk-based application and don't
want the
user to be able to switch between other windows. If there isn't a
way to do
this insid
Hi Ricky:
Which version of OS X are you using? With the latest of Leopard, it just
doesn't seem to work.
On 8/5/09 7:34 PM, "Ricky Sharp" wrote:
>
> On Aug 5, 2009, at 8:45 PM, Pierce Freeman wrote:
>
>> I am wondering if anyone knows of a way to disable Exposé in
>> SystemUIMode.
>> I am u
I didn't see anyone else mention this, so I have good news and bad
news...
The good news is, yesterday new debug & profile libraries appeared on
ADC. Woohoo!
The bad news is, they're for 10.5.7. 10.5.8 was just launched today,
so if you've already upgraded, then you'll have to wait a whil
I assume that just because I can toll-free bridge something
between core foundation and NSFoo I still have to worry about
CFretain/CFrelease in a GC app. Correct?
Example:
Assume image is an CGImageSourceRef.
NSDictionary *metadata =
(NSDictionary *) CGImageSourceCopyPropertiesAtIn
A general question. Suppose I wanted to write a Cocoa application that
could be accessed via a PHP script running on another machine on the
local network, what would the general shape of the solution look like?
The Cocoa app could run either as a command-line tool or a continually
running s
On Aug 5, 2009, at 8:11 PM, Marco S Hyman wrote:
I assume that just because I can toll-free bridge something
between core foundation and NSFoo I still have to worry about
CFretain/CFrelease in a GC app. Correct?
Correct.
Example:
Assume image is an CGImageSourceRef.
NSDictionary *metad
On 06/08/2009, at 1:11 PM, Marco S Hyman wrote:
I assume that just because I can toll-free bridge something
between core foundation and NSFoo I still have to worry about
CFretain/CFrelease in a GC app. Correct?
Example:
Assume image is an CGImageSourceRef.
NSDictionary *metadata =
> Is that correct?
Yes. A note though: since you're using NSMakeCollectable() (instead of
CFMakeCollectable()), the cast to (NSDictionary *) is unnecessary -
which is one of the main benefits of using the NS* version.
___
Cocoa-dev mailing list (Cocoa-d
I'm trying to create a borderless window which acts as a mask for the
desktop, sitting one level above the icons and staying in place as the
user works and switches between other apps and spaces. Most of this
behavior I can get with -setCollectionBehavior and -setLevel, but the
problem I'm having i
On 5 Aug 2009, at 12:08, Development wrote:
NSString * aString =[theWebView
stringByEvaluatingJavaScriptFromString
:@"document.getElementsByName(\"encrypted\").value"];
This Javascript will never work correctly, no matter whether it's from
HTML or from ObjC. getElementsByName returns a col
Hi,
Is the following piece of code legal?
Foo* foo = [[Foo aloc] init];
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"Item" action:
@selector(action:) keyEquivalent: @""];
[item setTarget: foo];
[foo release];
Unless I have a problem in some other part of my code, it seems that
releasi
Hi all,
I'm trying to implement a remote control for an application. The mouse
data is send to the application through a socket which is checked
regularly by a function triggered by a NSTimer. The data is then
transfered into the corresponding CGEvent. Interestingly this works as
long as
Just brainstorming theory here, but it might be made much easier if
you had a server act as an intermediary, even if all that server does
is 'introduce' the two iphones to each other.
Bryan McLemore
Kaelten
On Tue, Aug 4, 2009 at 1:10 PM, James Lin wrote:
> Correct me if I am wrong...but from w
I have an application I'm working on where I'm using mainly Bindings
for communicating with the UI, but I find myself in situations where
I'm not getting all the data updates to the UI.
These lack of updates seem to stem either from dependent keys, loose
coupling between objects, to-many relations
I recently updated some older code and converted to GC in the process.
Most of the time, things run fine. But every now and then I seem to
run into a CFRelease and/or a finalize down in system libraries or
Apple Frameworks. The ImageIO framework and CFDateFormatter seem to be
the culprits i
Folks,
I recently switched to using an .sdef in my Cocoa app for defining AS event
handlers. The problem is that suddenly it looks like my app defines the
property 'points' and this breaks other apps which send AS events to mine.
In my .sdef, I do not define a 'point' or 'points' property, nor d
in carbon, you can have a sub menu that is used in more than one super
menu.
is there a trick to get this to go in Cocoa? otherwise i'm stuck with
cloning and managing all the clones (eg: if i enable a menu item, or
if i change the key shortcut, or change the item text, i have to find
al
Hi all,
I am making a NSDocument based app. In the NIB for the document window, I need
to create a connection to a "global" data object (think singleton). This
"global" data is used when creating the document, but isn't part of the
document.
Normally I'd make a connection by dragging a NSObjec
I'm using NSOutlineView and NSTreeController to display and edit an
NSXMLDocument on Mac OS X 10.5. The application uses bindings and is
based on the "Using Tree Controllers with NSXML Objects" example in
the Tree-Based XML Programming Guide. I get some strange behavior when
I add elements
getElementsByName, as the name applies, returns a collection.
On Wed, Aug 5, 2009 at 12:08 PM, Development wrote:
>
> I'm trying to get a value for a specific variable to tell if a transaction
> is complete on iphone. In the didFinishLoading delegate method I have placed
> this code:
>
> NSString
I noticed that the recent update of Mac OS X 10.5.8 breaks
compatibility with previous versions regarding XQuery statements in
NSXMLNode, specifically using the XQuery function tokenize. I
originally reported this bug against a future version of Mac OS X and
now seems to have slipped into t
On 04/08/2009, at 6:46 PM, Remko Tronçon wrote:
Foo* foo = [[Foo aloc] init];
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"Item" action:
@selector(action:) keyEquivalent: @""];
[item setTarget: foo];
[foo release];
Unless I have a problem in some other part of my code, it seems that
Thanks.
It is working well.
On 8/5/09 10:24 PM, "Agha Khan" wrote:
> Dear Mahaboob:
> Many people have answered this question but I will take this route.
>
> First of all you only have call srandom once in you program. Best place is
> when you are going to load the object.
>
> I defined 2 mac
On 06/08/2009, at 5:41 AM, David M. Cotter wrote:
in carbon, you can have a sub menu that is used in more than one
super menu.
is there a trick to get this to go in Cocoa? otherwise i'm stuck
with cloning and managing all the clones (eg: if i enable a menu
item, or if i change the key s
On Aug 4, 2009, at 06:51, Björn Bollensdorff wrote:
I'm trying to implement a remote control for an application. The
mouse data is send to the application through a socket which is
checked regularly by a function triggered by a NSTimer. The data is
then transfered into the corresponding CGE
Oftenwrong Soong wrote:
I am making a NSDocument based app. In the NIB for the document
window, I need to create a connection to a "global" data object
(think singleton). This "global" data is used when creating the
document, but isn't part of the document.
Normally I'd make a connection
On Aug 4, 2009, at 11:35, Kaelten wrote:
I have an application I'm working on where I'm using mainly Bindings
for communicating with the UI, but I find myself in situations where
I'm not getting all the data updates to the UI.
These lack of updates seem to stem either from dependent keys, loose
On Aug 5, 2009, at 10:24 PM, Quincey Morris wrote:
The problem is that it's perfectly legal for something (e.g. a
NSButton responding to a mouse-down) to use a local, modal event
loop -- a "while" loop, not a NSRunLoop -- using
nextEventMatchingMask:untilDate:inMode:dequeue: to get the eve
Hi:
I have a UINavigationBar where I would like to place 2 buttons. I was
looking UINavigationBar.h for its implementation and didn't see the
way we could add more than 2 buttons(Right hand side and left hand
siderightBarButtonItem ) but my both buttons are rightBarButtonsItems
where one o
On Aug 4, 2009, at 18:12, dp wrote:
I recently updated some older code and converted to GC in the
process. Most of the time, things run fine. But every now and then I
seem to run into a CFRelease and/or a finalize down in system
libraries or Apple Frameworks. The ImageIO framework and
CFD
On Aug 5, 2009, at 13:33, Mark Szymczyk wrote:
I'm using NSOutlineView and NSTreeController to display and edit an
NSXMLDocument on Mac OS X 10.5. The application uses bindings and is
based on the "Using Tree Controllers with NSXML Objects" example in
the Tree-Based XML Programming Guide. I
I had this exact problem. I did exactly what he did, and to continue
this, yes, I did create a mapping model. Never got it to work, but I
had a user base of 1 and a database of about 10 objects at the time,
so I just abandoned attempting migration entirely and recreated the DB
with the new
72 matches
Mail list logo