Re: Mantaining legacy APIs in a framework

2015-09-01 Thread Maxthon Chan
This seems like a bit of code smell - next time when you plan to ask the user of your libraries override a method, put it into a delegate protocol. By doing this the end user does not need to actually subclass you and hence internal call structure no longer is part of the contract you have to ke

Re: Mantaining legacy APIs in a framework

2015-09-02 Thread Maxthon Chan
still respected and old program will still work. By the way mark your old method as deprecated, as it will generate a warning and motivate the users of your library to adopt the new interface faster. > On Sep 2, 2015, at 08:18, Graham Cox wrote: > > >> On 2 Sep 2015, at 4:41 a

Re: Mantaining legacy APIs in a framework

2015-09-03 Thread Maxthon Chan
Is it possible to respect the old contract throughout? The extra information can be exposed to the concrete subclasses through private interface. Sent from my iPhone > On Sep 3, 2015, at 07:44, Graham Cox wrote: > > >> On 3 Sep 2015, at 1:34 am, Maxthon Chan wrote: >>

Re: SOAP Server library/framework for Objective C

2015-09-11 Thread Maxthon Chan
Plug: I am writing a general-purpose FastCGI framework, CGIKit, for Objective-C, and couple this to any FastCGI-capable Web server (nginx, Apache with mod_fcgid even IIS) you get a complete Web stack. Also CGIKit is more likely than not to be able to be ported to Linux. CGIKit: https://github.c

Re: Identifying a specific Mac model

2015-09-13 Thread Maxthon Chan
I think this can only be done by searching Apple databases, or try to understand the machine’s serial number. I don’t think Apple now allows the developer to do this at all. > On Sep 14, 2015, at 08:09, John Daniel > wrote: > > Hello, > Does anyone know of an API or utility that will identify

Re: Identifying a specific Mac model

2015-09-14 Thread Maxthon Chan
It is encoded but only in the serial number, which you have no access to, and have almost no way to map back. > On Sep 14, 2015, at 18:16, sqwarqDev wrote: > > > On 14 Sep 2015, at 01:09, John Daniel wrote: > >> >> MacBook8,1 covers all colours of the new MacBook. >> I am trying to differen

Re: Is it possible to transfer data by using light

2015-09-18 Thread Maxthon Chan
I used to have a multi-factor authenticating door lock using this QR code mechanism. The lock is powered by Raspberry Pi, and have a 128px by 64px monochromatic screen, a camera and an RFID reader attached on it. Procedure to unlock the door: 1. You swipe a RFID card across the lock. A QR code

Re: Is it possible to transfer data by using light

2015-09-18 Thread Maxthon Chan
The "over-the-shoulder" issue can be avoided using what is effectively a Diffie-Hellman on top of QR codes. This can be done using front-facing cameras on two devices placed face-to-face. Sent from my iPhone > On Sep 18, 2015, at 00:46, Pascal J. Bourguignon > wrote: > > > >> On 17/09/15 1

Re: Beep ( duration, frequency )

2015-09-24 Thread Maxthon Chan
If there is only a small selection of frequencies and durations your app need to play, you can pre-record them as audio files and play them back when required. If it’s something like an instrument or requires procedurally-generated audio, you may want to package the sound effect you want into a

Re: Installing older OS X

2015-11-17 Thread Maxthon Chan
For me the installation media is always an SD card in the built-in card reader (which is usually faster than USB if the card itself is fast enough) Sent from my iPhone > On Nov 18, 2015, at 09:52, Quincey Morris > wrote: > >> On Nov 17, 2015, at 17:42 , Shane Stanley wrote: >> >> Does this

Re: Installing older OS X

2015-11-17 Thread Maxthon Chan
Quincey: Two points: 1) Your machine should be no newer than OS X 10.8.5 or driver issue will happen. 2) You need to create an install media (wiping it in the process) and perform an fresh install (wiping the partition in the process). Sent from my iPhone > On Nov 18, 2015, at 08:50, Quincey M

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Maxthon Chan
If you can call /usr/bin/env you can use that as an intermediary. Sent from my iPhone > On Dec 16, 2015, at 15:47, Rick Mann wrote: > > I'm working on an OS X app that unfortunately has to call a series of bash > and python scripts for part of the processing it does. I was able to include > t

Creating a Xcode toolchain, platform and SDK: how?

2016-03-10 Thread Maxthon Chan
Dear List: I am wondering how should I assemble a new toolchain, a new platform that it can target and a new SDK for it to develop on? The new toolchain, platform and SDK should be standalone. Sent from my iPhone smime.p7s Description: S/MIME cryptographic signature ___

CFRunLoopRef to NSRunLoop: how?

2014-11-19 Thread Maxthon Chan
I am writing an Objective-C wrapper for CFRunLoopSource called KLSRunLoopSource, that matched a Version 0 run loop source to an object by using delegation for callbacks. Now I have problem mapping the schedule and cancel callbacks to Objective-C. Constructing the CFRunLoopSourceContext using Ob

Re: CFRunLoopRef to NSRunLoop: how?

2014-11-19 Thread Maxthon Chan
> On Nov 20, 2014, at 03:59, Ken Thomases wrote: > > On Nov 19, 2014, at 1:00 PM, Maxthon Chan wrote: > >> I am writing an Objective-C wrapper for CFRunLoopSource called >> KLSRunLoopSource, that matched a Version 0 run loop source to an object by >> using d

Re: Making the Versions Browser less of a dog

2014-11-19 Thread Maxthon Chan
> On Nov 20, 2014, at 09:36, Graham Cox wrote: > > As we know, the Versions Browser causes your app to open an actual document > for each version it displays in the Browser. > > If you have large documents that cause a complex drawing to need to be > rendered, the experience is horrible - eac

Re: CFRunLoopRef to NSRunLoop: how?

2014-11-22 Thread Maxthon Chan
This library is designed to work with 3 implementations of Foundation with as few changes as possible: Apple’s Cocoa (No CFRunLoop-to-NSRunLoop conversion), Cocotron (built with CFLite, designed their NSRunLoop as toll-free bridged class) and GNUstep (CoreFoundation, optional and not installed b

Re: About building my own framework

2014-11-26 Thread Maxthon Chan
> On Nov 27, 2014, at 13:12, ico wrote: > > I just create a demo project to experience building my own framework. So > far everything works fine. However, if I set my app deploy target to > iOS7.0, and do the same for the framework target, then I get a warning: > "ld: warning: embedded dylibs/fr

WTF is happening?

2014-12-13 Thread Maxthon Chan
This got me scratching my head, hard. Why would class_respondsToSelector() crash? (BTW this is used in a class search loop so I cannot use [NSObject respondsToSelector:] just yet.) /Users/technix/Developer/Subtitler Pro/Frameworks/SubtitleKit/SubtitleKitTests/SKSubripParseTest.m:33: error: -[S

Re: WTF is happening?

2014-12-13 Thread Maxthon Chan
What I am doing here is scanning all loaded classes for subclasses of a certain class. Before any NSObject method can be issued I have to check if it is actually NSObject or NSProxy derivative instead of an Object derivative that does not support NSObject methods. This calls for runtime equivale

Re: WTF is happening?

2014-12-13 Thread Maxthon Chan
14, 2014, at 03:34, Gary L. Wade wrote: > > If all you care about is if an object is a proxy or not, look at isProxy. > -- > Gary L. Wade (Sent from my iPad) > http://www.garywade.com/ > >> On Dec 13, 2014, at 11:06 AM, Maxthon Chan wrote: >> >> What I am do

Re: WTF is happening?

2014-12-13 Thread Maxthon Chan
ived from NSObject nor NSProxy, then change > your design. > -- > Gary L. Wade (Sent from my iPad) > http://www.garywade.com/ > >> On Dec 13, 2014, at 11:40 AM, Maxthon Chan wrote: >> >> Ain’t work! Will crash if an Object derivative showed up. >> &g

Re: WTF is happening?

2014-12-13 Thread Maxthon Chan
too). > > If you find subclasses of Object, you are obviously doing something wrong. > >> Le 13 déc. 2014 à 20:57, Maxthon Chan > <mailto:m...@maxchan.info>> a écrit : >> >> NSProxy checking actually work, but throwing those classes that derive from &g

Re: WTF is happening?

2014-12-14 Thread Maxthon Chan
My class scanning returned several OS* classes that does not conform to NSObject protocol. > On Dec 15, 2014, at 00:29, Clark S. Cox III wrote: > >> >> On Dec 13, 2014, at 11:57, Maxthon Chan > <mailto:m...@maxchan.info>> wrote: >> >> NSProxy

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
ng a base > class other than "NSObject" or "NSProxy". Why can't you just ignore such > classes? > > Sent from my iPhone > > On Dec 14, 2014, at 23:31, Maxthon Chan <mailto:m...@maxchan.info>> wrote: > >> My class scanning returned s

Re: NSRegularExpression segfault

2014-12-15 Thread Maxthon Chan
I ran into the same problem trying to write a parser of a markup language. I would suggest you to use some mechanism to break this long input to smaller chunks to match. Reggie is only good for lexical analysis which only deal with smaller chunks, bigger blocks need to be handled using grammatic

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
What I am doing here is to determine a format handling class based on file extension. I want to achieve a drop-to-plugin-folder-and-it-will-work effect and allow one plugin to include multiple format handling classes. Also since I am creating an open system I don’t want to require other plugin w

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
the classes loaded. Also, SKFormat does not have any instance methods, only class methods, just to prevent any autorelease pool holding onto it. > On Dec 16, 2014, at 02:09, David Duncan wrote: > > >> On Dec 15, 2014, at 9:59 AM, Maxthon Chan > <mailto:m...@maxchan.info

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
On Dec 16, 2014, at 06:25, Wim Lewis wrote: > > > On Dec 13, 2014, at 11:06 AM, Maxthon Chan wrote: >> What I am doing here is scanning all loaded classes for subclasses of a >> certain class. Before any NSObject method can be issued I have to check if >> it i

Re: WTF is happening?

2014-12-16 Thread Maxthon Chan
> On 15 Dec 2014, at 19:19, Maxthon Chan wrote: >> My current design is that the main code is never possible of holding strong >> references to plugin code for extended periods. Main code keeps an eye on a >> folder and whenever a new bundle is dropped in it is loaded, a

Re: system sounds in iOS

2014-12-20 Thread Maxthon Chan
There is nothing preventing you from pointing a microphone and hitting record button. If you can find some device, preferably mechanical, that produces those sounds point a microphone at it and use Garageband to touch it up a little bit. If you have you can also make your own sound effects with

Re: get class of a method

2015-02-22 Thread Maxthon Chan
In Objective-C, methods are called my sending messages, and message selectors are not bounded to a class. You can walk all loaded classes and try to work out the classes that responds to the message selector in question, but beware classes that descended from the old Object class (not NSObject

Re: Plugin bundle with Javascript

2015-05-19 Thread Maxthon Chan
If you can find a way to get the plugin plugged into your code then it is doable. JS can be considered as resources and some custom Info.plist keys can be introduced to index the required files. > On May 19, 2015, at 20:21, Georg Seifert wrote: > > Hi, > > I hope this it the right place to as

Re: Going back to non-ARC

2015-06-12 Thread Maxthon Chan
You can: 1) Compile the library separately and link it into your code bulk, if the C++ templates are not offending 2) Try to convert the library to ARC, and push your changes upstream 3) Opt out ARC on a few files while retaining ARC on most files > On Jun 12, 2015, at 17:00, John Brownie wrote

Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
News outlets says that Objective-C is quickly falling out of people’s attention and developers are turning away from it to Swift and C++. So what language will you use to code various parts of your new project? Objective-C? Swift 2? C++? Or the good old plain C? For me, it is still Objective-C

Re: iOS version check

2015-06-12 Thread Maxthon Chan
Bottom line, you can check using the Darwin kernel version number which maps to iOS version number as reported using uname(2) sys call which is there since the dawn of iOS. The kernel version number have a roughly one to one relationship with the system version number. There exists a few minor

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
weirdo as my recent Web project is written in pure C, as an Apache 2.4 module. > On Jun 13, 2015, at 09:31, Roland King wrote: > > >> On 13 Jun 2015, at 08:51, Maxthon Chan wrote: >> >> News outlets says that Objective-C is quickly falling out of people’s >

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
Maybe my ID card says I am 22 but I had an early start on programming than most of my peers, so just treat me as a 40-year-old since I have some decades-old die-hard habits accumulated already. My first language ever learned is C actually, and then I spent almost 10 years tackling Visual Basic

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
ind the discussions in this forum, as well as the Xcode and > ObjC-language lists to be quite stimulating. Is there a Swift list in the > works? > > >> On Jun 13, 2015, at 07:31, Maxthon Chan wrote: >> >> Maybe my ID card says I am 22 but I had an early start on

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
just a straight compile. > On Jun 14, 2015, at 06:53, Quincey Morris > wrote: > > On Jun 13, 2015, at 15:33 , Maxthon Chan <mailto:m...@maxchan.info>> wrote: >> >> Swift is, technically, a dialect of Objective-C with some syntactic sugar >> and compile-

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Maxthon Chan
The language complexity issue of C++ is one of the main reason it put me off so much. And there is someone out there who posted a method of creating an iOS app with no Objective-C code at all but quite a lot of runtime abusing. The same method can be used on C++ but that requires some understand

Re: Language options: Objective-C, Swift, C or C++?

2015-06-14 Thread Maxthon Chan
I actually don’t use C++ with Objective-C - in fact, I flat out hate it from the half year being forced to use it in a CS course. Actually I even created a rough Foundation clone and migrated almost all programming paradigms from Objective-C to C++. Compare this: CCArray *array = CCArray::alloc

Re: Buy music on iTunes

2015-06-15 Thread Maxthon Chan
You cannot do this directly, but you can, via opening a link using -[UIApplication openURL:], to direct the user to iTunes Music Store app to but the song. Remember that iTunes Music Store is not available in every country and region. > On Jun 15, 2015, at 20:37, Viacheslav Karamov wrote: > >

Re: Language options: Objective-C, Swift, C or C++?

2015-06-15 Thread Maxthon Chan
The only feature in Swift that is useful for me so far is its ability to be executed like a script using its REPL feature. And to use it I need Swift being open source. Things will go off topic beyond this point. I always had an Objective-C Web framework (not a WebObjects revival, but a more “

Re: Most People Still Use Dialup

2015-06-16 Thread Maxthon Chan
From where I live despite we have fiber broadband connection but in practice it is slow like hell when connecting to anything that is not on the same carrier, and 4G traffic is extremely expensive (US$10 for 1GB of traffic.) Since I don’t write games, I try my best to make apps as tiny as possib

Re: Language options: Objective-C, Swift, C or C++?

2015-06-16 Thread Maxthon Chan
You actually can build the OS X and iOS versions of the same framework with the same name, just keep the targets in separate projects and double-check when linking. > On Jun 16, 2015, at 16:36, Kevin Meaney wrote: > > >> The other major problem I ran into — unrelated, but I’m mentioning it in

Re: Language options: Objective-C, Swift, C or C++?

2015-06-16 Thread Maxthon Chan
t that. I keep forgetting that Swift has a > form of #if. > > > On Jun 16, 2015, at 03:22 , Maxthon Chan wrote: >> >> You actually can build the OS X and iOS versions of the same framework with >> the same name, just keep the targets in separate projects and double-c

Re: Language options: Objective-C, Swift, C or C++?

2015-06-16 Thread Maxthon Chan
I like the storyboard references, but where’d object references go? > On Jun 17, 2015, at 02:14, Kyle Sluder wrote: > > On Tue, Jun 16, 2015, at 02:34 AM, Roland King wrote: >> And now I know what Kyle looks like too! > > You know what I look like with a bad haircut and not a lot of sleep. :P

Re: [OT] We appeared in Product Hunt

2015-06-17 Thread Maxthon Chan
Congratulations bro :) Max > On Jun 18, 2015, at 00:34, Juanjo Conti wrote: > > Hey! Today we appeared in Product Hunt > http://www.producthunt.com/tech/screensaver-ninja > > Yesterday we lunched our 1.0 version for Mac OS X. Thanks for all the > support in this mailing list! > > -- > > Jua

Re: [OT] We also appeared in Product Hunt

2015-06-17 Thread Maxthon Chan
Congratulations :-) BTW, if your app have the ability to scrape similar data for China it will be VERY welcomed. Chinese are very concerned about air quality now. > On Jun 18, 2015, at 10:37, Sal Conigliaro wrote: > > We also made it onto Product Hunt! > http://www.producthunt.com/tech/fresh-a

Re: Getting a server to trust the client. (iOS)

2015-06-22 Thread Maxthon Chan
You can use a second authentication factor though. For example, push notifications (which ties back to Apple servers and the device’s serial number) and SMS verification code (commonly found in two-factor authentication schemes) > On Jun 23, 2015, at 02:05, Kyle Sluder wrote: > > On Mon, Jun 2

Re: Why do so many iOS apps have such poor quality?

2015-06-23 Thread Maxthon Chan
From my limited job experience, most iOS apps are written by less than competent programmers with a rushed deadline. There is no such concept of quality control or even system design in general. Take your example, this exposed a system design bug that the designer have draw the line between har

Re: Email editor view

2015-06-27 Thread Maxthon Chan
Well I think for smaller images you may be able to embed it not as an attachment but as a data URL directly in the HTML. > On Jun 27, 2015, at 05:15, Jens Alfke wrote: > > >> On Jun 26, 2015, at 1:45 PM, Nick wrote: >> >> Would experienced developers suggest is the best way to have an email

Re: Communicating with a child process in app sandbox

2015-06-28 Thread Maxthon Chan
You can make your XPC service multithreaded - spawn one thread for each request. > On Jun 29, 2015, at 01:05, SevenBits wrote: > > For my latest app (sandboxed, and in development for the App Store), I am > spawning a child process so that I can delete some files without involving > the main a

Re: Distinguishing "home" and "commercial" use

2015-07-24 Thread Maxthon Chan
You can leave a small self-contained program running until the current user session is terminated once your app is started on a machine and expose its usage through Bonjour. And then when the free version of your app is starting it scans bonjour for such services, and refuse to launch if the ser

Re: Private Methods

2015-08-18 Thread Maxthon Chan
My own preference is to prefix private methods with underscores and the project’s class prefix. For example, from source code of WebUIKit (class prefix CGI, taken from its parent project CGIKit): NSString *const k_CGI_PrivateMemberAttribute; @interface CGIView () + (id)_CGI_superviewWithClass:

Thread-safe singleton with lazy initialisation

2015-08-18 Thread Maxthon Chan
Is this the proper way to initialise a singleton object in a thread-safe manner? A little bit background, I am rewriting my CGIKit Web development framework for Objective-C and now Swift, and after the idea of building the Web application into a loadable bundle that either a FastCGI-speaking cgi

Re: Thread-safe singleton with lazy initialisation

2015-08-18 Thread Maxthon Chan
sparsely. > On Aug 19, 2015, at 00:18, Simone Tellini wrote: > > Il giorno 18/ago/2015, alle ore 18:00, Maxthon Chan ha > scritto: >> >> So the first class that is required is the main application class >> CGIApplication. Being the analogue of UIApplication it i

Re: Thread-safe singleton with lazy initialisation

2015-08-18 Thread Maxthon Chan
sparsely. > On Aug 19, 2015, at 00:18, Simone Tellini wrote: > > Il giorno 18/ago/2015, alle ore 18:00, Maxthon Chan ha > scritto: >> >> So the first class that is required is the main application class >> CGIApplication. Being the analogue of UIApplication it i

Re: Private Methods

2015-08-18 Thread Maxthon Chan
The compiler knows absolutely NOTHING. It is up to the runtime to determine which implementation to call when a message is sent. This is the dynamic nature of Objective-C. > On Aug 19, 2015, at 02:28, Richard Charles wrote: > > >> On Aug 18, 2015, at 11:20 AM, Jens Alfke wrote: >> >> Yeah,

Writing portable Cocoa apps (especially data models)

2013-07-23 Thread Maxthon Chan
Have anyone of you guys tried GNUstep, the Cocoa clone (predates Cocoa!) that works on Linux systems? And have any of you guys tried to write portable code that builds on OS X/Cocoa and Linux/GNUstep? From my experiencesit seemed to me that recent versions of GNUstep (staying on svn HEAD here)

Re: Unrecognized selector in release build, not in debug build

2013-07-23 Thread Maxthon Chan
NSArrayI is one of the private subclasses of NSArray (not NSMutableArray) so there is no - (void)removeObject method. Consider check if your array is really mutable and - (instancetype)mutableCopy if needed. Sent from my iPhone > On 2013年7月10日, at 9:39, Rick Mann wrote: > > I'm having a hard

Re: Mixing Obj-C and C "methods"

2013-08-07 Thread Maxthon Chan
My common way of handling this would be NSNotificationCenter. It is a singleton so I am always sure that it is there, and I can wrap all parameters into the userInfo dictionary. Sent from my iPhone > On 2013年7月30日, at 21:19, KappA wrote: > > I sometimes just access my objc-objects from a C th

Re: Mixing Obj-C and C "methods"

2013-08-07 Thread Maxthon Chan
Sorry, clicked a wrong button. On Aug 7, 2013, at 16:00, Maxthon Chan wrote: > Well here is a reason I think that is valid enough to implement a callback > using notifications: that is what Objective-C use for what callbacks used to > do, besides target-actions and delegations.

Web development using Objective-C and Cocoa

2013-08-09 Thread Maxthon Chan
Hi everyone. Have anyone of you written any Web application (i.e. code that runs on a Web server) in Objective-C? I am currently working on CGIKit (version 6), an open-source Web development framework for Objective-C, sort of a WebObjects replacement. I am here to ask you for any advices (or in

Re: Web development using Objective-C and Cocoa

2013-08-09 Thread Maxthon Chan
o be pretty comparable to writing > Cocoa/Objective-C. > > On Aug 9, 2013, at 9:20 AM, Maxthon Chan wrote: > >> Hi everyone. >> >> Have anyone of you written any Web application (i.e. code that runs on a Web >> server) in Objective-C? I am currently working

Re: reverse scanner

2013-08-10 Thread Maxthon Chan
NSScanner is *not* a parser - it is a lexical analyser and you are the one that is responsible of writing a parser on top of it. I have a project Subtitler (http://github.com/xcvista/Subtitler) that included 2 parsers that is built on top of NSScanner, and I vaguely remember that there is an Sma

Re: Major Xcode irritation

2013-08-13 Thread Maxthon Chan
I just destroy the PCHs before the projects started. Sent from my iPhone > On 2013年8月13日, at 3:31, Graham Cox wrote: > > Has anyone else run into this? > > You open a system header from the SDK into XCode, and due to muscle-memory, > absent-mindedness, reflex, lack of context or whatever, you

Re: predefined macro iOS vs OS X

2013-08-16 Thread Maxthon Chan
Well I’d go with a conditional like: #if TARGET_OS_IPHONE typedef CGRect NSRect; typedef CGSize NSSize; typedef CGPoint NSPoint; #define NSMakeRect CGRectMake #define NSMakePoint CGPointMake // etc #endif and go with NS* variants. On Aug 16, 2013, at 20:17, Rick Mann wrote: > One thing to

Re: predefined macro iOS vs OS X

2013-08-17 Thread Maxthon Chan
I actually got one step (sorry for the pun) ahead as limited to what Cocoa’s Foundation and GNUstep’s Base have in common. That allows me to create code-compatible programs that builds and runs under both OS X (or iOS) and Linux. (In my company everything starts off in Objective-C and now with t

Re: predefined macro iOS vs OS X

2013-08-17 Thread Maxthon Chan
Data, Core Graphics, WebObjects (in Objective-C) and more. On Aug 18, 2013, at 1:15, Marcel Weiher wrote: > > On Aug 17, 2013, at 18:03 , Maxthon Chan wrote: >> On Aug 17, 2013, at 23:52, Marcel Weiher wrote: >>> On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: >>&

Re: Variable Number of Parameters in Method

2013-08-22 Thread Maxthon Chan
This is actually an ABI issue. Objective-C method calls are essentially C function calls: [NSArray arrayWithObjects:@1, @2, @3, nil]; is really (C function symbol name is guessed from a common name mangling scheme) __objc_c_NSArray_arrayWithObjects_([NSArray class], @selector(arrayWithObjects:

Fwd: Protocols and the +initialize class method

2013-08-23 Thread Maxthon Chan
Begin forwarded message: > From: Maxthon Chan > Subject: Re: Protocols and the +initialize class method > Date: August 23, 2013 at 23:30:19 GMT+8 > To: Fritz Anderson > > Well you can category on NSObject to perform the checking. > > Sent from my iPhone > >&g

Re: Exception After Adding a WebView to a NIB

2013-08-24 Thread Maxthon Chan
Well in Xcode [REDACTED] (or rather, clang 3.3) it is automated if you included its header file. So sit still and it will no longer be an issue soon. On Aug 25, 2013, at 11:26, dangerwillrobinsondan...@gmail.com wrote: > No worries. > It's such a common miss with such a common framework that it

Re: Modifying the default -Prefix.pch file

2013-08-25 Thread Maxthon Chan
I don’t use it, at all. (as in, I remove it from my projects.) Also, I always have a +thisDelegate method in my app delegate which is simply a return [UIApplication sharedApplication].delegate. On Aug 25, 2013, at 23:25, Devarshi Kulshreshtha wrote: > I would like to know how I can modify the

Re: Experience with keyed archiving forward/backwards compatibility?

2013-09-01 Thread Maxthon Chan
I use keyed coding with defaults to solve this issue, keys never change meaning after definition, app should ignore non-recognised keys and missing keys are defaulted or inferred from existing ones. On Sep 1, 2013, at 23:07, Marcel Weiher wrote: > Hi Graham, > > thanks for sharing your experi

Re: preventing launch

2013-09-01 Thread Maxthon Chan
Terminate it immediately after launch? Sent from my iPhone > On 2013年8月30日, at 20:47, Tony Giaccone wrote: > > > > Is there a programatic way to prevent the launch of a particular application? > I want to prevent certain applications under particular situations from > starting up. > > >

Re: 30x faster JSON date parsing

2013-09-09 Thread Maxthon Chan
This may not be that useful in all circumstances - I always send dates as milliseconds since the UNIX epoch as 64-bit signed integers. Those are *way* faster to parse. On Sep 10, 2013, at 0:11, Jens Alfke wrote: > Parsing dates from strings can be surprisingly expensive — more than once > I’ve

Re: 64-bit iOS

2013-09-10 Thread Maxthon Chan
When you use the system call mmap(2) to map in a huge file you will find it useful. Sent from my iPhone > On 2013年9月11日, at 4:01, Abdul Sowayan wrote: > > Scott, > > I'm curious, why does 64-bit matter? iPhone memory is still around 1 gig and > there is no virtual memory. Until you exceed th

Re: 64-bit iOS

2013-09-10 Thread Maxthon Chan
gt; On Sep 11, 2013, at 12:03 AM, Maxthon Chan wrote: > >> When you use the system call mmap(2) to map in a huge file you will find it >> useful. >> > > How so? > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: [OT] iTunes 11.1 Beta

2013-09-18 Thread Maxthon Chan
You need to be an iPhone developer. Or you can use the DFU mode. On Sep 18, 2013, at 17:42, Dave wrote: > Hi, > > I've been trying to reset an iPhone that has iOS 7 installed and I get a > message about it needs iTunes 11.1 to continue. I can't seem to find it on > the Apple Developer Site, i

Re: Identify extension of a file without extension

2013-09-28 Thread Maxthon Chan
It will not work for iOS app. However you can include your own copy of file(1) utility in your code. It is open sourced so you can make it part of your code. On Sep 29, 2013, at 5:34, Devarshi Kulshreshtha wrote: > Thanks, will check for sure.. one more query.. will it be applicable in an > io

Re: collection of applications

2013-10-11 Thread Maxthon Chan
This is not new - it existed since iPhone OS 1.0. However by saying “can load dynamic libraries” does not mean you can actually use it in production code. Apple does not allow any dynamic libraries exist in App Store packages (“Nobody but Apple can put dynamic libraries onto iOS device") so the

Re: collection of applications

2013-10-12 Thread Maxthon Chan
taking the thread off topic so I think this is it. On Oct 12, 2013, at 11:22, Jens Alfke wrote: > > On Oct 11, 2013, at 7:57 PM, Maxthon Chan wrote: > >> This is not new - it existed since iPhone OS 1.0. However by saying “can >> load dynamic libraries” does not mean yo

Re: collection of applications

2013-10-13 Thread Maxthon Chan
App Store rules does not apply to in-house enterprise apps. On Oct 14, 2013, at 12:13, Quincey Morris wrote: > On Oct 13, 2013, at 21:06 , "Rufat A. Abdullayev" wrote: > >> Yes I'm planning to create a portal (enterprise in the meaning that all our >> apps could be used/called from one app).

Re: collection of applications

2013-10-13 Thread Maxthon Chan
NSTask. Also you can use traditional UNIX fork/exec to execute the secondary binary. However the secondary must be a command-line binary not an application bundle. On Oct 14, 2013, at 12:06, Rufat A. Abdullayev wrote: > Hello Chan and other guys, > > Thank you a lot for your answers. > > Yes

Re: collection of applications

2013-10-13 Thread Maxthon Chan
t case > > > > From: Maxthon Chan [mailto:xcvi...@me.com] > Sent: Monday, October 14, 2013 8:23 AM > To: Rufat A. Abdullayev > Cc: Jens Alfke; Cocoa-dev > Subject: Re: collection of applications > > NSTask. Also you can use traditional UNIX fork/exec to execute

Re: collection of applications

2013-10-13 Thread Maxthon Chan
Rule 2.8 disallow you execute code that is foreign to your application bundle but use of auxiliary executables are still allowed, in the example of iSSH app. On Oct 14, 2013, at 12:23, Rufat A. Abdullayev wrote: > Hi Quincey > > Thank you for noticing that. > > > One say: "2.8 > > Apps that

Re: collection of applications

2013-10-13 Thread Maxthon Chan
I need to dig more into that > > From: Maxthon Chan [mailto:xcvi...@me.com] > Sent: Monday, October 14, 2013 8:35 AM > To: Rufat A. Abdullayev > Cc: Quincey Morris; Cocoa-dev > Subject: Re: collection of applications > > Rule 2.8 disallow you execute code that is foreig

Re: collection of applications

2013-10-13 Thread Maxthon Chan
URL schemes or just bake in. On Oct 14, 2013, at 12:45, Rufat A. Abdullayev wrote: > Yeah really! What a pity L > > So only URL scheme or included libraries > > > > From: Maxthon Chan [mailto:xcvi...@me.com] > Sent: Monday, October 14, 2013 8:41 AM > T

Re: collection of applications

2013-10-13 Thread Maxthon Chan
o dynamic library and > include that into main app bundle > > > > From: Maxthon Chan [mailto:xcvi...@me.com] > Sent: Monday, October 14, 2013 8:30 AM > To: Rufat A. Abdullayev > Cc: Jens Alfke; Cocoa-dev > Subject: Re: collection of applications > > You can use a

Re: collection of applications

2013-10-14 Thread Maxthon Chan
, Fritz Anderson wrote: > On 13 Oct 2013, at 11:29 PM, Maxthon Chan wrote: > >> method call -[UIApplication _terminate], it is private but since your apps >> are in-house you are not bind to the rules > > Strictly speaking, this is not so. The Enterprise license (whe

Re: collection of applications

2013-10-14 Thread Maxthon Chan
PM, Maxthon Chan wrote: > >> Maybe you have to tell your management that it is technically infeasible to >> do so in iOS without jailbreaking. Either you bake them all in/use separate >> SpringBoard icons or the dynamic libraries will not be loaded in vanilla iOS >&

Re: C functions

2013-10-17 Thread Maxthon Chan
You actually can, by using dlsym(3) to resolve the symbol, cast it to the appropriate function pointer and call it. For example: int (*myfunc)(int, int) = dlsym(RTLD_DEFAULT, myfunc_name); if (myfunc) printf(“%d”, myfunc(2, 3)); else fprintf(stderr, “error: cannot resolve symbol: %s”, my

Re: C functions

2013-10-19 Thread Maxthon Chan
libclang is more than that. Xcode code highlighting and code indexing is based on lib clang, as well as delta compilation. (and I have a remote plan of cloning Xcode for GNUstep) Also, there was a friend of mine that created a translator that converts code from a new language to C, and I modifi

Re: 3rd party executable in iOS project

2013-10-21 Thread Maxthon Chan
If you can understand the code, just read it and make it a library. Else, you need an alternative. Try research on how iSSH work. (They have a separate PuTTY executable, due to license issues) On Oct 22, 2013, at 10:52, Koen van der Drift wrote: > > On Oct 21, 2013, at 10:12 PM, Roland King

Re: Deadlock during NSCache flush

2013-10-21 Thread Maxthon Chan
What about the “database” object? Is that yours? If so, can you retain/autorelease it (using runtime functions documented by LLVM) when purging? On Oct 22, 2013, at 10:53, Jens Alfke wrote: > > On Oct 21, 2013, at 6:57 PM, ChanMaxthon wrote: > >> Can you just manually retain it before cleani

Re: 3rd party executable in iOS project

2013-10-21 Thread Maxthon Chan
No, this pipe/fork/dup2/exec is used in App Store apps - iSSH is an example as it used its separate PuTTY executable. Maybe straight fork() is not available but is there some replacement like posix_spawn()? iOS itself need some sort of mechanism to fork/exec or there will be no apps. On Oct 22,

Re: Deadlock during NSCache flush

2013-10-21 Thread Maxthon Chan
If your app is called Hammersmith, you can retain/autorelease it in your [CBLDatabase dealloc] or [CBLCache dealloc] On Oct 22, 2013, at 11:03, Jens Alfke wrote: > > On Oct 21, 2013, at 7:57 PM, Maxthon Chan wrote: > >> What about the “database” object? Is that yours?

Re: 3rd party executable in iOS project

2013-10-21 Thread Maxthon Chan
I stand corrected - iOS fork() refuses to work. On Oct 22, 2013, at 11:59, Clark S. Cox III wrote: > > On Oct 21, 2013, at 20:02, Maxthon Chan wrote: > >> No, this pipe/fork/dup2/exec is used in App Store apps - > > No. I am sorry, but you are wrong. > >> iSS

  1   2   >