Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView text]: [closed] - ios

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
- (IBAction)addButtonTouched:(UIButton *)sender
float vei = [vekt.text floatValue];
float huy = [hoyde.text floatValue];
float hoy2 = huy/100;
float ski1 = hoy2 * hoy2;
float ski = vei/ski1;
float skileng1 = 1.45 * ski;
float ski2 = 21 - ski;
float ski3 = 8 * ski2;
float skileng = skileng1 - ski3;
self.BMi.text = [NSString stringWithFormat:#"%f", skileng];
Thats the code, i get this message, when pressing button:
2013-06-09 22:41:43.978 BMI[2773:11303] -[UIView text]: unrecognized selector sent to instance 0x8896610
2013-06-09 22:41:43.980 BMI[2773:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView text]: unrecognized selector sent to instance 0x8896610'
*** First throw call stack:
(0x1c92012 0x10cfe7e 0x1d1d4bd 0x1c81bbc 0x1c8194e 0x2358 0x10e3705 0x172c0 0x17258 0xd8021 0xd857f 0xd76e8 0x46cef 0x46f02 0x24d4a 0x16698 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44 0x1c37e1b 0x1bec7e3 0x1bec668 0x13ffc 0x203d 0x1f65)
libc++abi.dylib: terminate called throwing an exception
Any help?

BMi is pointing to a UIView which does not have a text getter/setter/property.

You need an outlet or using the sender to set text. It is telling you that there is no method doing what your trying to do..

Related

NSInternalInconsistencyException - Animator is already stopped

Currently getting the following runtime exception
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Animator <UIViewPropertyAnimator(0x600003f24200) [stopped] interruptible> is already stopped!'
Because of the following line of code
// other code up here that modifies offsetAnimator
...
// stop any current running animations on offset
if let offsetAnimator = offsetAnimator {
offsetAnimator.stopAnimation(false) // this line is where the exception gets raised
offsetAnimator.finishAnimation(at: .end)
}
What is perplexing, however, is why this error is NOT readily reproducible
// doing this doesn't always result in an error
if let offsetAnimator = offsetAnimator {
offsetAnimator.stopAnimation(false)
offsetAnimator.finishAnimation(at: .end)
offsetAnimator.stopAnimation(false)
offsetAnimator.finishAnimation(at: .end)
}
What on earth is happening? Can someone explain to me why this error is occurring?
Why does it seem to only happen sporadically? Shouldn't calling .stop twice always trigger it?

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIImage systemImageNamed:]:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIImage systemImageNamed:]:
The above error is received on running the below code:
let image = UIImage(systemName: "square.and.pencil")

Customize camera overlay in applozic

I am using applozic chat sdk for ios and sending images , video successfully . My requirement is to change camera overlay. When I try to add overlay on camera it crashes.
let camaraObj : ALImagePickerController = ALImagePickerController()
let overlay =UIView(frame: UIScreen.mainScreen().bounds)
overlay.backgroundColor = UIColor.redColor()
camaraObj.cameraOverlayView = overlay
Crash log: libc++abi.dylib: terminating with uncaught exception of type NSException.
Any help ?
Looks like you are not setting the sourceType. ALImagePickerController is used for sending pictures from photos only. You need to explicitly set source type if you want to use it for camera.
i.e. self.mImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
We just tried the same and got below exception:
2017-01-30 14:30:30.954540 applozicdemo[3106:1925853] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type must be UIImagePickerControllerSourceTypeCamera' First throw call stack:
(0x1819de1c0 0x18041855c 0x187a945cc 0x187d23294 0x1003f9dcc 0x10016525c 0x10016521c 0x10016a284 0x18198bf2c 0x181989b18 0x1818b8048 0x18333e198 0x1878a42fc 0x18789f034 0x1000517b8 0x18089c5b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

[CIContext initWithOptions:]: unrecognized selector sent to instance 0x170400960 in xcode8

run in ios8.3 ,but run in ios9 or 10 hasn't this problem.
-[CIContext initWithOptions:]: unrecognized selector sent to instance 0x170400960
2016-09-19 18:08:21.025 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CIContext initWithOptions:]: unrecognized selector sent to instance 0x170400960'
*** First throw call stack:
(0x186d8c2d8 0x1985b00e4 0x186d933a4 0x186d90154 0x186c92ccc 0x1001c1e74 0x1001c1b7c 0x1001c143c 0x1001c1cfc 0x100311e0c 0x1003116d0 0x1001d7690 0x101f3025c 0x101f2fc08 0x101eee29c 0x103db8fd4 0x103db8f94 0x103dbdc28 0x186d437f8 0x186d418a0 0x186c6d2d4 0x1904836fc 0x18b832fac 0x100401fd8 0x198c2ea08)
libc++abi.dylib: terminating with uncaught exception of type NSException
If you look at the crash report, it seems that Xcode 8 has some issue converting the Swift method CIContext(options: [String : Any]?) to its Objective-C counterpart + (CIContext *)contextWithOptions:(NSDictionary<NSString *,id> *)options;.
Instead it is converted as -[CIContext initWithOptions:] hence the unrecognized selector.
One possible workaround is to declare an Objective-C category like this:
#interface CIContext (Workaround)
+ (CIContext *)yourprefix_contextWithOptions:(NSDictionary<NSString *, id> *)options;
#end
#implementation CIContext (Workaround)
+ (CIContext *)yourprefix_contextWithOptions:(NSDictionary<NSString *, id> *)options {
return [CIContext contextWithOptions:options];
}
#end
Then import this category in your module bridging header and replace your original CIContext init call with the one from this category.
I imagine this is a compilation issue that can be fixed with an Xcode update. In the meantime, this workaround may be helpful.

UITextFieldView markedTextRange crash on iOS4?

My apps use UITextFieldView to receive input method from user and work fine on iOS6/iOS7. and I am using the following code to prevent user input chinese/japanese/something like that. Method to detect the real input words:
-(void)textFieldChanged:(UITextField *)textField
//crash here if device iOS version at 4.3
UITextRange *selectRange = [textField markedTextRange];
if (selectRange == nil)
//get word to do something...
Crash log :
2013-11-20 12:35:09.480 [My app][203:607]-[UITextField markedTextRange]: unrecognized selector sent to instance 0x287e270
2013-11-20 12:35:09.480 [My app][203:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextField markedTextRange]: unrecognized selector sent to instance 0x287e270'

Resources