Gerriet M. Denkmann wrote:
2012-...] Bad Array: (
\U0e01\U0e38\U0e0d\U0e41\U0e08,
\U0e04\U0e38\U0e13\U0e04\U0e48\U0e32
)
For a very long time, the -description method of NSArray (and other
collection classes) has produced the old-style ASCII plist format.
Since that format has
koko wrote:
I forgot to add that the deployment target is 10.4 … which is why
I asked …
Look at NSFileManager's deprecated methods, and find
changeFileAttributes:atPath: .
-- GG
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Charlie Dickman wrote:
What I want to do is determine the ratio of inactive to free in
order to determine when to execute the purge command to free up the
inactive memory before the system gets into trouble.
It's unnecessary to purge or free Inactive memory.
Quoting from:
koko wrote:
I have 29 file types and wanted to get away from the if or switch
to open them and let NSDocument pick the right class for me.
As I understand it, an Item in the Document types array of the
plist contains and entry for an NSDocument class.
And yes, each type has a unique
Koen van der Drift wrote:
u_int32_t value;
[base64DecodedData getBytes:value range:NSMakeRange
(n*4, sizeof(u_int32_t))];
u_int32_t res = CFSwapInt32HostToBig(value);
float f;
memcpy(f, res, sizeof(f));
Nathan Sims wrote:
Hmm, if not a global, where would the declaration go? The C
function certainly shouldn't return it, so if it is to remain
persistent across calls, wouldn't the logical (the only?) place for
it be as a global in the library's .m file?
Why shouldn't the C function
Quincey Morris wrote:
The problem is that the documentation clearly states that
exceptions must not try to escape across dispatch queue operation
boundaries. AFAICT, this means that for every one of the tiny code
block fragments I write, not only does my fragment need to be
wrapped in a
Jerry Krinock wrote:
Not necessarily. Multiple overflows tend toward a random number
generator.
Doubles overflow to +INF, as do floats. Arithmetic on INFs typically
yields one of the INFs (+INF or -INF). It is decidedly non-random.
It would be an interesting experiment, though.
--
Oleg Krupnov wrote:
I'd like to get the mount options of a particular volume (like rw,
nobrowse, automounted etc.) of a mounted volume, like those I get
when I run mount command in the Terminal.
See the C function statfs().
See the include file sys/mount.h, struct statfs, member f_flags.
See
Todd Heberlein wrote:
If not, does anyone know how is diskutil getting this information?
For example getfsstat(), statfs(), ...? I'm having troubles
finding the equivalent of BusProtocol and Internal values in
these structures.
BusProtocol is probably worked out from the device
Gordon Apple wrote:
There must already be an array for the table, so just iterate the
array every
minute or whatever (single repeating timer), compare the times to
[NSDate
date} and start or shut down whatever has not been started or shut
down. Much
easier than trying to manage
Charles Srstka wrote:
It’s a little disturbing that private instance variables can be
altered so easily, but then I suppose the same thing could just as
easily be done by a third-party monkeying with the ivar in a category.
No programming language with direct memory access is ever
Jon Sigman wrote:
Also, won't I need to increase shmmax in the kernel, especially if
I have numerous flavors of the 1GB matrix to load?
What is a flavor of a matrix?
You need to explain what you're doing in terms of the data and its
representation. How is the matrix data represented on
Sean Leonard wrote:
Does anybody know how the display names for these keychains are
localized, and how I can use this behavior for another keychain?
What have you tried?
Maybe it's the same way other file-system names are localized:
Peter C wrote:
Graham, I used to store serial number codes for all users, in this
directory.
Looks like I have change it to save it user library directory.
The /Users/Shared/ directory is public-writable, with sticky-bit set
(unless that changed in Lion, too). See 'man sticky' for an
Wilker wrote:
Before Lion, it really works well and fast, even on Wifi external
drive
(through Airport Extreme), but now it get's really slow... I did some
checks, and now its reading the entire file... instead of just read
128kb
(start and end). Anyone have an ideia on why its happening
Eric E. Dolecki wrote:
//Get the very best match there is to be found for
song.
if(match currentFoundValue){
currentFoundValue = match;
test = [songsDictionary objectForKey:thisSong];
dis = [NSArray
Kevin Muldoon wrote:
Well, as I indicated, it's only a bit of icing on the cake. I'm
just a bit shocked such an trivial task in a scripting language
requires such heavy lifting in Obj-C (or more accurately, C).
The Finder's spotlight comment is stored as an xattr attached to
the file.
koko wrote:
So, is there really an
NSApplicationWillFinishLaunchingNotification or is Apple just
pulling my leg?
From the reference doc for the NSApplicationDelegate protocol:
applicationWillFinishLaunching:
Sent by the default notification center immediately ***before the
application
Eric E. Dolecki wrote:
http://www.cocoadev.com/index.pl?NSStringSoundex
However, when I tried it out I get strange results...
//someString is set to different strings each time tested
BOOL test = [someString soundsLikeString:@Face];
NSLog(@sounds like Face: %d,test);
Place = 0
Ace = 0
Mace =
James Merkel wrote:
Everyone doesn't approach this stuff with the same background.
We find from Kernighan and Ritchie (KR) second edition, section
8.1 that a file descriptor is a small non-negative integer that
refers to a file and is maintained by the system.
Wikipedia is also a useful
Jeffrey Walton wrote:
Wikipedia is hardly the definitive reference. SEO comes to mind.
Luckily, I didn't say Wikipedia was a definitive reference. I said
useful reference. And anyone at all familiar with it knows full
well that its accuracy (and usefulness) can vary widely. I, for one,
Sandeep Mohan Bhandarkar wrote:
Have i missed anything else...??
All the protocol's methods are declared @optional. That means the
compiler won't check whether you've spelled your implementation's
method-name correctly. I have seen more than one case where it was
misspelled, despite
Leonardo wrote:
2) During the period of time the stream is off, if some new files
arrive
within the folder /A, I lose the notification to copy it.
How to workaround that?
Make a directory adjacent to /A and /B to use as a staging area for
copying. Only copy into the staging area.
Kevin Muldoon wrote:
I have an NSTable which receives its dataSource from
MyTableController.m. However, my AppController.m needs the data
MyTableController.m holds. Since AppController.m hasn't explicitly
instantiated MyTableController (MyTableController being an NSObject
within IB with
Matt Neuburg wrote:
Why are we able to do that? m.
Because ARC is public knowledge:
http://clang.llvm.org/docs/AutomaticReferenceCounting.html
-- GG
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or
Martin Hewitson wrote:
What I'm unsure about is, how to deal with the children objects. I
will, in principle, have a ChildView. This raises some questions:
1) Should I have a ChildViewController class?
I don't think there's a single answer. Parent/child relationships
can be presented
Nick wrote:
This per user idea does not let me use any advertisement-based
IPCs (like
user domain sockets or bonjour). I need some per user only IPC -
so other
user's instance of the process does not interfere with the current
user's
one.
A Unix domain socket can be placed anywhere
McLaughlin, Michael P wrote:
I have a Cocoa app (Xcode 3.2.6) which displays text output in a
window. This is pure output not meant to be edited by the user.
Accordingly, the textfield is marked as not editable or selectable
in IB.
Speaking as a possible user, it is often useful to be
julius wrote:
My question is
Why did Cocoa developers make NSArray count return NSUInteger?
It's impossible to answer with certainty. The person or persons who
made that decision are not on this list (AFAIK). Nor have they
documented the rationale behind their design decisions for
koko wrote:
I had changed the string I was appending to @\n\nText to Add
which also did not work.
You need to identify whether your string is a literal string in your
Objective-C source, or whether it's something loaded from somewhere
else.
If it's loaded from somewhere else, you need
James Merkel wrote:
I was trying to come up with a way to prevent the user from
starting at the wrong place. (Putting up an Alert that says you
can't start there). There's a method in the NSFileManager class
called isDeletableFileAtPath. I am thinking that all of those
volumes and higher
Bing Li wrote:
I believe TCP can be used between Java and iOS. However, I worry that
particular serialization exists in CocoaAsyncSocket so that Java
cannot
deserialize successfully. Do you think the issue exists?
No. If there is an issue, it's almost certainly in your code.
First, I
Laurent Daudelin wrote:
I've found different ways to do that (some pure Cocoa, some using
Carbon) but I was wondering about the wisdom of this list as to
what is the best way to detect the encoding of a file before
passing it to NSString initWithContentsOfFile:encoding:error:?
You might
Laurent Daudelin wrote:
I need to write an application that will scan entire drives and
compare files between the 2 drives.
man rsync
See the --dry-run, --stats, and --progress options in particular.
rsync can also run as a daemon, which may be easier than trying to
control it with
Alexander Cohen wrote:
Is there anyway to do interprocess locks using cocoa ( like a Mutex
in Win32 )? The best i've found is not cocoa and uses flock but the
man pages say its advisory only which is kindof scary.
man semget
man semop
man semctl
They're part of the Posix IPC functions,
Michael Crawford wrote:
The following gdb console output demonstrates an instance of a
media-item persistent-ID property that, when queried gives a large
unsigned number. When I ask again using the -longLongValue method,
I get the answer I was expecting. When I look inside the set, you
Robert DuToit wrote:
I have been googling around and not sure how to do this - is it
with NSData or NSStream perhaps?
You can use standard C's stdio lib: fopen(), fread(), fseek(), etc.
Objective-C is a superset of C. You can use any C library in
Objective-C, exactly the same way
Jeremy Matthews wrote:
I can't help but think there might be a better (and more efficient
way) of handling this?
How much better (and more efficient) does it have to be?
It's a simple game, right? Is it currently too slow or memory-
consuming? If not, why change it?
If you want a
Shane wrote:
So I guess my question is, how do I make sure my view is able to
receive the data I want sent to it before it is ever displayed. I hope
that makes sense.
Send the data to a Model, not a View. If the View and Model are the
same object, then the only way to have a Model is to
Jon Sigman wrote:
The underlying issue I was having was how to know when different
objects used as
keys might be reasonably expected to match, especially if they
weren't generated
the same way (as with [NSNumber stringValue] and [NSString ...]).
That's easy: they match when isEqual:
Sandro Noël wrote:
- (NSDictionary *) plist{
NSMutableDictionary *resultDict = [[[NSMutableDictionary alloc]
init] autorelease];
if ([self hasChildren]){
NSMutableArray *child = [[[NSMutableArray alloc]init]
autorelease];
for (OSXMLElement *element
Sandro Noël wrote:
the glitch that breaks all my current logic is when there are
elements with the same name at the same level.
for instance in a RSS,
rss
chanel
item
item
item
this breaks the logic I can apply to a NSDictionary,
Gustavo Pizano wrote:
Any way to improve even more performance?, when I have many many
BCItemView on the scene, (around 120+), it takes like 10 seconds
to save. :S
Measure where your code spends its time by running it in
Instruments.app and using the Time Profiler. Use the
Ariel Feinerman wrote:
How to get label color before 10.6?
If you mean using Interface Builder, select a label, choose
Attributes on the Inspector panel. Also notice the class of the
label: NSTextField.
Then look in NSTextField.h:
- (void)setBackgroundColor:(NSColor *)color;
-
Frederick C. Lee wrote:
2) Static variables on stack -- I was aware of this.
Static and on stack are mutually exclusive. It's impossible to
have a variable that is both, so static variables on stack is
nonsense.
BTW, the C storage specifier for on stack is auto. You might
want to
N!K wrote:
However, exactly the same statement fails when pasted into -init of
Class.m.
Build yields warnings Class may not respond to -new.
This message suggests you're calling an instance method, not a class
method, or that's the way the compiler is interpreting it.
Post your
Rick Mann wrote:
Note that the precision of all this isn't so high as to make this
hard real time. It just has to be good enough that a person
watching the display and comparing it (visually) to an accurate
clock would consider them to be synchronized. I'd like to do no
worse than 100
koko wrote:
NSString *outPath = [nspath stringByAppendingString:@/..namedfork/
rsrc];
ok = [fm createFileAtPath:outPath contents:data attributes:nil];
This won't work. You must first create the file (i.e. create the
data fork). Only after the file exists can you open and write to its
koko wrote:
although I have implemented a different solution, just to note the
data fork (the file) does exist, it is nspath in the first line.
I don't see nspath being used to create a data-fork file in any code
you posted. It may be in the code you didn't post, or if I've missed
it,
eveningnick wrote::
Basically this is the question about using fork in MacOS. But if there
are other ways to launch a process, i'd appreciate if someone shared
:)
Maybe setup a launchd plist specifying the target executable you want
to run, then ask launchd to run it by executing the
Dave Carrigan wrote:
This is fine, although the code in the else is useless.
It won't be fine if err is nil. That's another Cocoa idiom: if the
NSError** is nil, then no NSError* is returned.
-- GG
___
Cocoa-dev mailing list
Trygve Inda wrote:
Or does NSArrayController somehow bind to a non-array property,
but one
that responds as if it were an array?
Later in my original post, I suggested subclassing NSMutableArray, so
it can bind to NSArrayController. Your new class, i.e. MyDataClass,
doesn't just
Trygve Inda wrote:
Each dictionary (or object with properties) will need to hold
roughly 9
textual strings, and there will be on the order of 10,000 objects
in the
array. I am guessing that dictionary will perform better than a
predicate
filter given the number of objects.
Never guess
Trygve Inda wrote:
This is probably true since this is a very minor part of my app...
I simply
need an array to display in a table with the added functionality of
being
able to locate a record uniquely (each object in the array has a
unique ID
as one of it's properties).
I recommend
G S wrote:
Well, this has proven to be a stumper. In case the XIB was corrupted,
I deleted the whole thing and started over. Same result. It's a
deal-breaker, since this is the main interface of my app. Total
standstill.
I don't recall seeing any of your code that calls reloadData.
Trygve Inda wrote:
Ultimately I have a masterDict containing a few thousand dicts (all
having
the same structure) which I need to convert to an array of dicts to be
displayed in an NSTable.
When I add to this array (quite rarely), I will actually add a new
dict to
the masterDict and then
Naresh Kongara wrote:
I want to know how to make java calls from Obj-C. (Java Bridge
Seems to be deprecated).
Is it possible with out bridge ? If yes , Can any body help me on
Where to start ?
Use JNI.
Also see this Java-Dev message:
Nick Zitzmann wrote:
So I found this, which has an answer that is not use the bridge
but I haven't tried it myself: http://stackoverflow.com/questions/
1822549/calling-java-library-from-objective-c-on-mac
One of its answers is use TCP/IP. I have done that, and it works
well.
Timothy Mowlem wrote:
I can run the XCode built app as well from the command line after
setting LD_LIBRARY_PATH (as a non-admin user and without using sudo).
If that env-var is the cause, then printf() the value of it in both
cases, and manually compare them. Use the getenv() C function.
Daniel Lopes wrote:
But what you think about separate custom views in diferent nibs? Is
that
right?
Try it. See what happens. Repeat as needed.
A lot of design questions can only be answered well by experience.
Either you already have the experience from an earlier project, or
you
Abhijeet Singh wrote:
Hi,I am working on a multithreaded software that runs on a medical
instrument. The software has 2 parts. GUI and worker threads
(worker threads sends commands to instrument). The GUI is developed
using ObjectiveC and Cocoa. Worker threads are all in C and
Carbon.It
Amy Heavey wrote:
... I've tried just using strings, but the applicationSupportFolder
returns a string, which then is immutable so I can't add to it?
There's a significant misconception lurking here.
None of the NSString methods for appending or deleting actually
modify the NSString they
Process group code:
// launch the task
[task launch];
pid_t group = setsid();
if (group == -1) {
NSLog(@setsid() == -1);
group = getpgrp();
}
if (setpgid([task processIdentifier], group) == -1) {
NSLog(@unable to put
Philip Mobley wrote:
My question is basically how does NSCountedSet handle string
values, are they interpreted by their string values or by their
object values? If they are by object, then I need to do more work
to pull the exact key object from the NSDictionary.
NSCountedSet inherits
Philip Mobley wrote:
The author of the article is somewhat unsure whether using -
isEqual: is safe, but after looking at the [NSString hash]
documentation I feel confident in my current implementation.
That author is confused, and should consult some reference
documentation. It's really
Sandro Noël wrote:
There is no need for that data to be backed up anywhere, as it is
retrievable from the web service.
the cached data is used for offline operations and later synced
back to the web service.
We want to control when the data becomes available in an
unencrypted format.
and
Steve Wetzel wrote:
if ([sender tag] 10) {
The operator is LEFT-SHIFT.
The operator is LESS-THAN.
If you want to understand what your code is doing, think about what
happens when the numbers 0-9 are left-shifted by 10 bits.
-- GG
Jon Loeliger wrote:
I'm writing a network server that needs to accept many
simultaneous client connections and keep track of them.
I've written the base server parts, roughly in the style
of the Apple Examples (SimpleNetworkStreamsExample). These
examples, however, only allow one connected
John MacMullin wrote:
Create a dictionary with the stream as the key, access and maintain
the dictionary and stream stuff with the key, (NSValue key), lock
or synchronize access to the dictionary. Applies to every pass
through handleEvent (and everywhere else), ie., any broadcast code.
Brad Stone wrote:
Yes, quoted-printable. That's precisely it but in doing my
research in the documentation and on the internet it doesn't seem
like it's a simple process especially for someone like me with 9
months of Cocoa development experience.
There is nothing apparent in your code
Shamyl Zakariya wrote:
So first off, is there some built-in way to simply 'goose' the app
and cause its defaults bindings to trigger?
There are any number of ways. You could send a signal with the
standard C function kill(). You could send a distributed
notification (see
vincent habchi wrote:
The analyzer does not figure out that the pt array gets initialized
through the loop by copying values directly from a chunk of memory,
and spits out the warning about pt [•] not being defined. Maybe I
should report this to the LLVM team?
That seems like a good
vincent habchi wrote:
That's true, the compiler cannot guarantee that dim 1, which is
always the case actually.
I am going to put an extra text at the beginning of the method,
like: if (dim 1) return; and see what happens.
If you need to guarantee dim 1, then your if statement should
Jeffrey J. Early wrote:
- The crash does *not* occur when the application (either release
or debug build) is launched within Xcode.
- The crash *does* occur if I launch the app with gdb from the
command line (same stack trace).
Inspect and then change things about your executable's
Brian Marick wrote:
I've not been able to find a way to add a secure note to a keychain
programmatically. SecItemClass in SecKeyChainItem.h gives no item
class for secure notes, which makes me wonder if they're not
actually in the keychain but stored somewhere on disk, encrypted
with the
kirankumar wrote:
How to run a application before login starts (ie, before when we
enter username and password).
http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html
-- GG
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Eric Hoaglin wrote:
I have the following code:
http://www.pasteit4me.com/763005
I'm trying to capture the output of the task that I run. and from
what I understand, if you want to do so, you pass a FILE*
to AuthorizationExecuteWithPrivileges and then just read it as a
normal file (which
And you also need to identify what OS version you're running on.
-- GG
___
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
If I have lots of connections, say two dozen, or say I'm spawning
connections continuously, would this be the most efficient way of
doing this? I'd likely store them in an NSArray and iterate/compare
until I find the right one. There could be lots of comparisons.
Use NSSet instead of
Georg Seifert wrote:
Does anyone has information on how to use Unicode code points
higher than 0x.
NSString is UTF-16. Use surrogate pairs.
-- GG
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests
Jens Alfke wrote:
I only saw one error: the method name “GetNSImage” should probably
be “image” (method names should be lowercase unless they begin with
a common acronym like “URL” or “TIFF”, and the prefix “get” is not
used.)
Also See These Methods Three:
[[frame Camera]
Kevin Boyce wrote:
Sure, it seems like it's just another dispatch from the runloop.
Which would be fine if it copied like 100K bytes per invocation, or
something like that. It seems instead to run off and copy vast
quantities of data before returning. Copying a 4MB MP3 file
actually
Pierre-Yves Aquilanti wrote:
NSData * binaryData=[NSData dataWithContentsOfFile:binaryPath]; //
binary is
just a 32bits array full of 1500. and 3000. as described previously
Does the endian-ness of the floats in the file match the endian-ness
of the processor the code is running on?
Development wrote:
What I get is a black rectangle of scrambled colors and no
discernible resemblance to the page data.
...
void * bitmapData = malloc(byteSize); ag
IIRC, malloc() does not initialize the returned memory. Since you
don't seem to do any other initialization, you
Reinhard Segeler wrote:
I post notifications to interchange infos between classes. They are
always
posted twice, even though they are surely only posted once. Does
anybody
know why?
Make sure you haven't registered two listeners, or a single listener
twice.
-- GG
Chris Idou wrote:
I've got an app that needs to send out emails. I'm trying to import
mail settings from Mail.app. For some reason my keychain has
passwords for smtp.gmail.com, but not for smtp.me.com.
AFAIK, there is only the one MobileMe password for all uses.
Double-click your
Jonathan Mitchell wrote:
MGSScriptExecutorManager *scriptExecutorManager;
NSString *tempFilePath;
}
@interface MGS_B : MGS_A {
@private
NSData *stderrData;
}
Change the ivars to something like this:
MGSScriptExecutorManager *scriptExecutorManager;
K.Darcy Otto wrote:
Question: Is there any header I can put at the beginning of the
text file to get it automatically recognised as UTF-8?
It's not a header, but there is the com.apple.TextEncoding xattribute.
See post #4 in the following thread:
Abhinay Kartik Reddyreddy wrote:
everytime you ask for a uniqueInstance it looks like it retrieves a
new instance not the existing instance... since you set the
uniqueinstance to nil inside that function, your function will
discard the previous instance if any and then create a new
appledev wrote:
arguments = [NSArray arrayWithObjects: @-c, @/bin/df -k| /
usr/bin/grep /dev/ | /usr/bin/awk '{print $1 $4 $5 $6;}',nil];
Your awk syntax is somewhere between quirky and wrong. Since you
didn't mention what the problem was, I will assume the output you
want is not
Todd Burch wrote:
[aSyncSocket receiveWithTimeout:-1 tag:1]; //Listen for the
next UDP packet to arrive...which will call this method again in turn.
Don't start another receive.
Handle or ignore the packet, then always return NO from the delegate
method. The single outstanding
Phillip Mills wrote:
I've read the notorious Technical Note TN2152, iPhone OS does not
currently provide a direct way for third party developers to
transfer data between the user's computer and their device, but I
assume common workarounds are in place. Obviously I could follow
the
Scott Ribe wrote:
NSDate * cd = [[NSCalendar currentCalendar]
dateByAddingComponents: dc toDate: [NSDate dateWithString:
@2001-01-01] options: 0];
I think the dateWithString: is wrong. From the NSDate reference:
You must specify all fields of the format string, including the time
zone
A couple suggestions:
If you always calculate using noon on any given date, rather than
midnight, then DST transitions won't affect the year/month/day
components.
If you don't want to use noon, then NSTimeZone
daylightSavingTimeOffsetForDate: should be taken into account.
-- GG
Bill Appleton wrote:
3) when i set the menus i have created for NSApp using setMainMenu
then...
what? who owns them? how do i set more menus for NSApp? how do i
get NSApp
to release the current set?
You are not responsible for NSApplication's retention or release of
menus. It alone is
Filip van der Meeren wrote:
What I was trying to do is the following:
C/C++ operator| NSCharacterSet operation
-
| (or) | [aCharSet
formUnionWithCharacterSet:bCharSet];
(and)
Bill Hernandez wrote:
I've worked with lots of number formatters over the years, and that
is what they do, format numbers into strings, any kind of string...
I looked at the header file for NSNumberFormatter, and there seem
to be 9,000,000+ methods, it is amazing. Buried in there, there
McLaughlin, Michael P wrote:
Is there a recommended (better) way of sending and receiving a
known (large)
amount of data to and from a subtask? Is there any sample code
anywhere
similar to what I need? I couldn't find anything close enough to
work.
Reading your description, my first
McLaughlin, Michael P. wrote:
main -- subtask (main send data)
-(void)sendData:(void*)data numBytes:(NSUInteger)sz taskTag:
(NSString*)tag
{
NSData *dataset = [NSData dataWithBytes:data length:sz];
NSNumber *num = [NSNumber numberWithUnsignedInteger:sz]; //
NSUInteger
NSDictionary
1 - 100 of 359 matches
Mail list logo