How do I post comment in dark background [closed] - editor

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Call me crazy...
Hey i wanna know that how you people comment or ask your question in dark background. I am new at this site so tried searching the FAQs but couldn't find the answer. How do you write your code related thing in different background and general sentences in simple background?
**Its a Check and it works.**

Do you mean
like this because this is a blockquote and you can use either a > prefix or highlight and click the speech marks
the other is a bit like this and that is a back tick ` which denotes a code block or you can highlight code like this
namespace SomeNameSpace
{
public class SomeClass
{
public int foo()
{
return 1+1;
}
}
}
Which does a similar thing and you do that by highlighting a block and clicking the {} button or you can indent from the beginning by 4 which buts it into that mode.
There are formatting hints in the editor (the orange question mark)

Related

Change the value of a variable inside podfile from viewcontroller [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
import UIKit
import Foundation
open class podview: UIView {
open var strk = UIColor.black
.
.
}
I have to change the value of "strk" from another view controller. Is it possible to do it.
YES, You can do it. There are two way to do this.
Local Notification (NSNotification)
NSNotificationCenter addObserver in Swift
Delegatation
Examples of Delegates in Swift
If you want to Change View controller B Value from View controller A then you can directly access to it.
For EX ViewcontrollerB.yourVariable = Assign value - From View Controller A
Please review and understand both concepts.
Happy Coding..:)
I'm just providing you trick.
Yes you can change it. First you need to import model of the pod.
then you need to create object of the podview and then you will be able to access strk like
objectOfPodView.strk

How to write a completion block in objective-C? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm having trouble creating completion blocks. I found the solution here
. It works for me, but I don't quite understand this. Now I'm still confused and don't know how to write a block myself. Are there any batter ways to understand blocks? Also, when should I use it? Is there anything that can replace blocks?
Should I create it as a property? Method perimeter? Do they have difference in efficiency?
Thank you!
check out http://fuckingblocksyntax.com for syntax.
For personal choice I like to return value and error in the completion block (similar to iOS framework pattern)
As an example;
declaration
- (void)fetchStuff:(void (^)(id value,NSError *error))completion;
calling the function
// async fetch
[object fetchStuff:^(id value, NSError *error) {
// do stuff with value
}];

How to pass int value from one class to another in xcode [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hai I am new to xcode My code is below,
-(void)XYZ:(NSString *)id1 {
int id2 = [id1 intValue];
NSLog(#"%d",id2);
}
I need to use the id2 value in another class like below,
-(NSArray *)Vehicles {
NSString *urlString=[NSString stringWithFormat:#"http://www.xxxxxx.com/xxx_webservice/vehiclelist.php?uid=%d&format=json",id2];
}
Please guide me to pass the value thanks in advance...
First, you should read some docs about objective-c and OOP.
What you are calling classes, are methods. And if you want to pass one variable to a method, you have to declare it in the method declaration:
-(NSArray *)Vehicles:(NSInteger) id2 {
NSString *urlString=[NSString stringWithFormat:#"http://www.tranzlogix.com/tranzlogix_webservice/vehiclelist.php?uid=%d&format=json",id2];
}
And you have to pass it when you call it, if you are calling the method from your class, a correct way will be: [self Vehicles:id2]
But i suggest you to read a lot before asking so basic questions.

restkit mapping [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
hey i'm new to iOS and having a hard time with RestKit
can anyone help me on how to do these two post requests
1)post a long value and map the response to
#interface CountResultVO : NSObject
{
long offercount;
long insertCount;
long favouriteOfferCount;
long favouriteInsertCount;
}
2)post the above object and map response to
#interface FooList : NSObject
{
NSArray * foo;
}
my main problem is posting payloads of primitive variables like int, long etc instead of mapped objects.
this may be useful to you: http://liebke.github.com/restkit-github-client-example/

Endless function calling loop [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I'm working on my iOS project again. However, I seem to have hit a cascading eternal loop of function calls of which I don't know why it happens. The GDB output can be viewed here:
http://img205.imageshack.us/img205/527/gdberror.png
dot notation is a syntactic sugar for setter/getter methods.
self.username = x;
is the same as
[self setUsername:x];
self.username uses the setUsername method, hence your issue. Just use:
username = user;
Remove the .self from your code.
When you write self.username you are calling your -(void)setuserName:(NSString*)user function again and again.
it should be
-(void)setUserName:(NSString*)user{
userName = user;
}

Resources