/r/ObjectiveC
Your news for everything ObjectiveC related.
/r/ObjectiveC
In C malloc
can fail if there is not enough memory in the system. What happens if I try [NSObject alloc]
while there is no memory available? Does it abort? Return NULL
?
So I have been wanting to make things like custom dock bar and things like that for my mac for quite a while. So I wanted to know if I would use ObjectiveC for that? or am I supposed to use another language, also how long would it take me to learn ObjectiveC to a degree at which I could accomplish what I mentioned above
Hello,
I'm an objective-C newbie, and I've got to work on some legacy code. A question I can't find a clear answer to is the difference between `[self attributeName]` and `self.name.`
So I declare a .h for a class, its attributes and methods and I want to interact with them in the .m. I usually feel more comfortable using `self.name` for assigning a value to the class's attribute and `[self attributeName]` for reading the value of the attribute, but I feel like they're totally interchangeable.
Am I correct or is there a real difference I'm missing ?
Thanks in advance !
-(void) someFunction {
ApiClass *apiObj = [[ApiClass alloc] init];
SomeObj *obj = [SomeObj objWithName:@"First Last"]; // Autoreleased obj
[apiObject doThingWithBlock:^(){ // Block - 1 (async - runs after 5 mins)
// Do some work
// ...
apiObject doAnotherThingWithBlock:^(){ // Block - 2
[obj performTask];
};
}];
[apiObject release];
}
If Block - 1 runs asynchronously, when is obj captured in Block - 2? If its not captured when the literal is seen, wouldnt it result in obj being released before the Block - 2 can retain it when it is executed 5 mins later??
This is what PyObj-C is,
"a bridge between the Python and Objective-C programming languages on macOS."
I am trying with Foundation to post a notification. I have had a successful NSNotification call of notificationWithName:object:
below, and I (believe I) instantiate it with defaultCenter(
).
postNotificationName:object:userInfo
.
@objc.IBAction
def helplink_(self, url):
print("ensssss")
x = Cocoa.NSNotification.notificationWithName_object_("hi", 88)
....Cocoa.NSNotificationCenter.defaultCenter().postNotificationName_object_userInfo_("name", x, None)
print(x)
However, I sadly dont get any notifications, is there another way I should be doing this (on Catalina) with other instance or type/instance methods? I'm not sure what to do besides do trial and error with other class objects to get the right comonbation.
ANY Help would be GREATLY appricated. Thanks! (On macOS 10.15.7)
BTW, whats the sender and receiver exactly in this Framework? Good resource for what it is?
I have a NSTableView that dynamically adds rows when the user enters relevant data. The table has a few columns and the last column contains a button that removes the row if needed. As it stands now, The row has to be selected to get its index. If the row isn't selected the button does nothing. So I would like to know if there is a way I can get the index of the row without having the select the row. So basically when the button is pressed is there a way I can obtain the index of row it's from without the row itself being selected. I'm new to objective C and I've been having quite lot of trouble figuring this out.
https://lowendmac.com/2014/stainless-browser-light-and-efficient-but/
What I find valuable is the “Single Session” functionality. With it, you can log into two different accounts of your favorite social media site (Facebook, Twitter, etc.). It will store the login credentials in RAM as opposed to a cookie, so when you close that tab the stored information is erased. For example, you have two Twitter accounts – one personal and one professional. Start up a Single Session, and you can have both running in separate tabs. Close the tab, and all that login information is erased.
Stainless was a browser that seems to be no longer functioning on the modern macOS (and not maintained by the creator). I liked the fact that if you had multiple accounts for one website, you could bookmark that, and it would not only bookmark the website but also keep you signed in, so that if you click that bookmark, it would go to the site with you already logged in.
This way you could make multiple bookmarks of the same website with different IDs.
If you have multiple Reddit IDs for example, it would be easy to switch from one account to another without having to log out.
How would you make another browser like this?
The developer wrote this about Stainless:
Stainless started out as a technology demo to showcase my own multi-processing architecture in response to Google Chrome (Stainless 0.1 was released three weeks after Google released Chrome for Windows). Sensing an opportunity and inspired by a growing fanbase, I decided to craft Stainless into a full-fledged browser and work on features that I hadn't seen before in other browsers.
A prime example is parallel sessions, which allow you to log into a site using different credentials in separate tabs at the same time. This new technology is woven throughout Stainless, from the private cookie storage system, to session-aware bookmarks that remember the session in which they were saved. I still believe this is a true browser innovation, and I'd love to see this implemented in Chrome.
Over the past couple of years it's been impossible for me to keep working on Stainless and as promised to many, here it is, finally available as open source and in need of serious maintenance. My last update (on 7/25/2011) was almost two years after I had stopped active development (11/04/09), and it was pretty much a bugfix release. As I had expected, Stainless remained interesting to users until Google finally released Chrome Beta for the Mac in September of 2009.
If you are going to fork, the easy path would be to setup a development system on Snow Leopard running XCode 3. That way you could build the current source successfully as it requires method swizzling (for multi-session cookie storage in WebKit) and private access to CoreGraphics internals (for handling cross-process window layering). The hard path would be to replace these with modern equivalents under XCode 4 (caveat: you would lose the PowerPC compatibility, which has helped keep Stainless popular on machines that can't run Chrome).
In the end, Stainless is still a hack: multi-process by way of carefully layered multi-applications with a shared state. And as a hack, some of its most serious issues (running in separate spaces for example) may be insurmountable. Still, Stainless was a hack to which I devoted over a year of my life and learned a lot about tricking OS X into doing my bidding. Hopefully it can still provide similar inspiration for other Mac developers. https://github.com/mesadynamics/stainless
Hi, I've got a string for exmaple like this - "sadsadsad https://www.youtube.com/results?search_query=martin+garrix"
How can I open up that url which is a part of NSString?
Hi, I would like to know how I could modify things such as the Dock and Finder with objective c.
I just finished going through the Programming with Objective-C guide and also the Start Developing Mac Apps Today guide but I have not had much chance to get to code anything yet (aside from some basic experiments with syntax and all that). I'm also quite new to coding (< 1 year experience) and I'm wondering where I could find some hands-on exercise to practice the concepts I've learned and also familiarize myself with Xcode. Thank you in advance!
I am looking at an open source github project and I stumbled upon this declaration. Can someone explain why all these qualifiers were needed.
I'm looking to contribute to my company's Objective-C code base, but I have no experience in iOS development. Any recommendations concerning resources to get up to speed quickly? Is it mostly learning syntax, language idioms, and frameworks?
I have a crash where the top of the stack looks like
0 libobjc.A.dylib 0x000000019ba5a5b4 object_getIndexedIvars + 36
1 com.apple.Foundation 0x000000019ca0bff4 -[NSRecursiveLock lock] + 20
2 com.apple.Foundation 0x000000019ca0bff4 -[NSRecursiveLock lock] + 20
I'm pretty sure that allocation initialized the lock.
What should I try?
The company is called CaptureOne, focused around the software with the same name, which is the best raw conversion program in the world, with increasing amount of image editing tools similar to those of photoshop.
I am a windows developer working there myself, and can tell you that it is an awesome place to work! Ask me anything.The main reason I chose to search myself, is because I am seeing an increasing distance between windows and mac developer capacity with so many eager windows developers. I want the company to continue thriving and develop as fast as possible, but the windows cannot do that if the mac cannot, as we want to keep the two platforms aligned.
While it is prefered to have developers in the offices in Denmark/Greece, they recently started hiring cross country as well, and maybe even help you move if you want. See https://careers.captureone.com/ad/mac-software-engineer/r8nhi1 for Mac developer and try to apply if interested.https://careers.captureone.com/work-with-us for other open positions
Best regards, ols.
Let me know if you successfully got a position, that'd be awesome
Hi! I have (sort of) a complex block here that apparently takes a block as argument and returns another block and I'm having a hard time telling where the return type is (I might be wrong about the parameters too so please correct me). I'm guessing it's the entire thing that starts from (^ (^complex
... but I expected the syntax to look like this. Please enlighten me! Tysm for your time!
Combined screenshots: https://imgur.com/a/3yKnyfi
Hi I want to learn objective c on windows and i found that i could do this by installing mingw on my pc and using Gnucore but i want to know how to connect all of them with IDE that helps me like Xcode on mac os i want an IDE for developing on windows
Hey Everybody,
I currently have a client that needs a couple of developers who can use Objective C and possibly have experience in building Android apps as well.
For some background, my company is called Autolance. We are a freelance matching service that instantly matches pre-vetted freelancers with projects that perfectly match their skillsets.
If you are interested, feel free to comment here, DM me privately, or go straight to this link (https://www.autolance.co/freelancers) and book a meeting slot so we can hop on a call.
I will also answer any questions you guys have on here directly.
Thanks!
Hi
Can anyone help me with layout of a uitableview on rotation?
CGRect frame = CGRectMake(kTableViewLeftInset, kTableViewTopInset, holder.frame.size.width - kTableViewLeftInset - kTableViewRightInset, holder.frame.size.height - kTableViewTopInset - kTableViewBottomInset);
_dataTableView = [[UITableView alloc]initWithFrame:frame style:UITableViewStylePlain];
_dataTableView.translatesAutoresizingMaskIntoConstraints = false;
_dataTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
(The kTableView constant values Im using are : kTableViewTopInset is 67,kTableViewBottomInset = 20;kTableViewLeftInset = 20;kTableViewRightInset = 20; just in case you're wondering about the height from the top)
Im fairly sure Im missing something (probably fundamental :) ) so any steer would be very welcome.
Thanks in advance
Loads in Portrait = OK, Happy........
rotates to landscape...tableview width not updating, Not Ok, Sad.
Header files include interfaces intended for public use, while implementation files include the code for whatever declared in the interface. However, if I were to send the .h file to someone without the .m, how would they be able to use it? I don't understand how the header file would be able to work without the implementation file that contains the code to be executed. :P
Add a category to NSString
in order to add a method to draw the uppercase version of a string at a given point, calling through to one of the existing NSStringDrawing
category methods to perform the actual drawing. These methods are documented in NSString UIKit Additions Reference for iOS and NSString Application Kit Additions Reference for OS X.
In this example (I'm following Apple's Objective-C guide), XYZShouthingPerson
is a subclass of XYZPerson
. I tried declaring secondPerson
as type XYZPerson
(XYZPerson *secondPerson
) and the program still works. Is there any particular reason why I should declare secondPerson
as type XYZPerson
instead of XYZShoutingPerson
? (The guide told me to declare secondPerson
as type XYZPerson
and I'm not sure why).