nsobject Questions
7
Solved
I want to force user to use my own init method (for example -(id)initWithString:(NSString*)foo;) and not the basic [[myObject alloc]init];.
how can I do that?
Obstreperous asked 18/1, 2012 at 9:25
2
I’m getting the following warnings in Xcode when building my app (app runs just fine however):
Could not associate debug note to atom
l_OBJC_LABEL_PROTOCOL_$_NSObject
Could not associate debug not...
5
I trying to understand class hierarchy. What are the sub classes of NSObject. Is there any graphical representation of the hierarchy?
Stomatal asked 24/7, 2010 at 0:4
1
Solved
I've been looking for a way to trigger a method when the number of displays connected to a mac changes. I know I can get the value of NSScreen.screens.count, but I need to find a way to create a no...
Riannon asked 24/11, 2021 at 21:41
4
Solved
When subclassing NSObject in Swift, should you override hash or implement Hashable?
Also, should you override isEqual: or implement the == operator?
2
Solved
In a blog post I have just read:
'Swift allows us to extend classes from NSObject to get Objective-C runtime features for an object. It also allows us to annotate Swift methods with @objc to allow...
Chopfallen asked 7/3, 2017 at 7:22
2
How to add multi line text with custom font in UIActionSheet swift.I have tried \n.but this is not working.is this possible or not.
Here is the my code.
alert.addAction(UIAlertAction(title: "l...
Dombrowski asked 5/9, 2019 at 13:35
4
Solved
I have a custom class defined as follows :
class DisplayMessage : NSObject {
var id : String?
var partner_image : UIImage?
var partner_name : String?
var last_message : String?
var date : NSDate?...
Sailesh asked 3/9, 2016 at 13:0
2
Solved
I'm trying to retrieve an array of custom object in Swift, where i get the error
"UserInfo={NSDebugDescription=value for key 'root' was of unexpected class 'NSArray'. Allowed classes are '{(Music...
Gaussmeter asked 20/5, 2019 at 8:42
5
Solved
3
Solved
i'm working on a iOS5+ project (xcode 4.4.1 SDK 5.1)
i have this code inside a unit test:
[_appDelegate application:nil didFinishLaunchingWithOptions:nil];
UITabBarController *tabBarController =...
Burge asked 12/9, 2012 at 10:30
3
Solved
I want to get all the native classes (NSString, NSNumber, int, float, NSSet, NSDictionary) that I have loaded into my iOS Project..
i.e., if I have created a custom class named "TestClass" I don't...
Inelegance asked 10/10, 2013 at 14:27
3
Solved
I have read some posts like this one about the difference between subclassing NSObject in Swift or just having its native base class with no subclassing. But they all are a bit old posts, and I am ...
Elsieelsinore asked 9/10, 2016 at 12:1
1
Solved
I am using ViewModel class and want to setup observer if any changes into loginResponse variable.
@objcMembers class ViewModel: NSObject {
var count = 300
@objc dynamic var loginResponse :Stri...
Turbellarian asked 5/5, 2018 at 7:38
5
What is the purpose/use of NSObject in Objective-C? I see classes that extend NSObject like this:
@interface Fraction : NSObject
In C++ or Java, we don't use any variables like NSObject even th...
Emilia asked 19/10, 2009 at 11:58
2
Solved
According to ARC in iOS, an object must have at least one strong reference to stay in memory, when there is no strong reference (ie. reference count becomes 0), the object will be deallocated from ...
Submerge asked 24/1, 2018 at 6:34
6
There is a current view as UIViewController which call "LoginView" but I'm not in, I'm in a NSObject class and I want to call, display an other UIViewController which is call "MapView". How can I d...
Inside asked 19/10, 2012 at 13:56
1
I'm making a game that needs to play music. To make my code more manageable, I wanted to make an NSObject that takes care of the sounds (like fading, playing sounds in a playlist, etc). I have this...
Wiggins asked 31/10, 2017 at 12:33
1
Solved
Following code works perfectly in swift 3.x but not in swift 4.
let selector = "managerDidDetectedStation:"
let observer = <UIViewController subclass object>
let station = <Station Object...
Cuthburt asked 3/10, 2017 at 13:11
6
All of the sudden Xcode is giving me an error "unexpected '@' in program" at the beginning of my object @interface.
This is happening in a bunch of my objects that were previously working...
Her...
Laminous asked 19/11, 2011 at 23:23
5
Solved
I created this class for my object City
class City: NSObject {
var _name:String = ""
var name:String {
get {
return _name
}
set (newVal) {
_name = newVal
}
}
}
then when I create my ob...
0
I'm just wondering why delegate in binding iOS project has to use BaseType(typeof(NSObject)) attribute when it's iOS counterpart does not use NSObject
iOS code:
@protocol TestDelegate
- (void)on...
Grenier asked 30/3, 2017 at 19:30
3
Solved
Here is the layout of an example Class, can someone guide me on what's best practice when creating a subclass of NSObject?
class MyClass: NSObject {
var someProperty: NSString! = nil
override ...
Yeaton asked 16/8, 2014 at 19:46
5
Solved
I'd like to JSON-serialize my own custom classes. I'm working in Objective-C / iOS5.
I'd like something to do the following:
Person* person = [self getPerson ]; // Any custom object, NOT based on ...
Tinfoil asked 9/5, 2012 at 11:17
3
I am blocking into something and I am sure it is too big.
I have a custom object that look like this
@interface DownloadObject : NSObject <NSCoding>{
NSNumber *key;
NSString *name;
NS...
Gile asked 4/7, 2011 at 8:51
1 Next >
© 2022 - 2025 — McMap. All rights reserved.